17

I have a problem after updating to Android Studo 2.3 Canary today.

The build completed with no error but when I run the app, the gradle console keeps showing:

android.databinding.annotationprocessor.ProcessDataBinding not found

Here's my build.gradle

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        jcenter()
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle 2.3.0-alpha1'
        classpath 'com.google.gms:google-services:3.0.0'
        classpath 'com.android.databinding:dataBinder:1.0-rc1'
        classpath 'me.tatarka:gradle-retrolambda:3.3.1'
        classpath 'me.tatarka.retrolambda.projectlombok:lombok.ast:0.2.3.a2'
        classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
        maven { url "https://jitpack.io" }
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

Thanks !

---Updated--- I was struggling for few days and I found where problem comes from. I use Parcels, Retrolamdas in my app, both libraries use 'apt' and that's problem.

build.gradle (root) bug version :

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.2.2'
        classpath 'com.google.gms:google-services:3.0.0'
        classpath 'com.android.databinding:dataBinder:1.0-rc1'
        classpath "me.tatarka:gradle-retrolambda:3.2.3"
        classpath 'me.tatarka.retrolambda.projectlombok:lombok.ast:0.2.3.a2'
        classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
        maven { url "https://jitpack.io" }
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

**build.gradle (app) bug version **

apply plugin: 'com.android.application'
apply plugin: 'com.neenbedankt.android-apt'
apply plugin: 'me.tatarka.retrolambda'
apply plugin: 'android-apt'

...

dependencies {
    compile 'org.parceler:parceler-api:1.1.5'
    apt 'org.parceler:parceler:1.1.5'
}

And here is fixed. build.gradle (root) fixed version :

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.3.0-alpha1'
        classpath 'com.google.gms:google-services:3.0.0'
        classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
        classpath 'me.tatarka:gradle-retrolambda:3.3.1'
    }
}

allprojects {
    repositories {
        jcenter()
        maven { url "https://jitpack.io" }
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

build.gradle (app) fixed version*

apply plugin: 'com.android.application'
apply plugin: 'me.tatarka.retrolambda'

compile 'org.parceler:parceler-api:1.1.5'
annotationProcessor 'org.parceler:parceler:1.1.5'

Conclusion. I changed retrolamdas repo version and remove plugin: 'android-apt' .I was found some helpful links if you want looks into details.

https://github.com/johncarl81/parceler/issues/201 https://bitbucket.org/hvisser/android-apt/wiki/Migration

Hope it helps :D

KhoaHA
  • 171
  • 2
  • 9
  • what do you need `dataBinder` for? – pskink Nov 12 '16 at 12:16
  • I only follow android data binding guidelines. any problem with dataBinder ? – KhoaHA Nov 12 '16 at 15:37
  • see https://developer.android.com/topic/libraries/data-binding/index.html#build_environment – pskink Nov 12 '16 at 15:43
  • I tried to remove the line classpath 'com.android.databinding:dataBinder:1.0-rc1' but it still keep show error above – KhoaHA Nov 12 '16 at 15:51
  • Same problem here. – miqqo Nov 12 '16 at 16:55
  • I'm guessing this is a problem related to android-apt. – BoD Nov 13 '16 at 16:39
  • Maybe. I was struggling on google but there's no luck :( – KhoaHA Nov 13 '16 at 17:48
  • had the same issue, it is coming from the new gradle pluging, you need to revert back to - classpath 'com.android.tools.build:gradle:2.2.2'on your main gradle file. But Then you must go back to Android Studio 2.2.2. both did the trick for me – oznus Nov 14 '16 at 01:16
  • Agree. I also did that - back to gradle 2.2.2 + Android Studio 2.2.2 and everything works fine. But I really need my project can run on AS 2.3 because Instant run very very slow (4 - 6 minutes) and it was fixed on AS 2.3 :) – KhoaHA Nov 14 '16 at 02:44
  • There are already two android issues filed: https://code.google.com/p/android/issues/detail?id=227612 and https://code.google.com/p/android/issues/detail?id=227657. For me it is enough to downgrade the gradle plugin to 2.2.2 for successful builds. – McFarlane Nov 14 '16 at 09:07
  • Yes we can downgrade to gradle 2.2.2 but it's bug and it should be fixed asap – KhoaHA Nov 14 '16 at 10:17

3 Answers3

6

This issue is triggered because we've moved data binding to annotationProcessor configuration (rather than provided). If you are using android-apt`, they'll conflict, stop using it. We also had another bug which prevented it from picking other processors. It is already fixed and will be available in the next alpha.

Original bug report here: https://code.google.com/p/android/issues/detail?id=227612. It also has a work around if you really need to use 2.3 .

yigit
  • 37,683
  • 13
  • 72
  • 58
4

I was using android-apt. I replaced with annotationProcessor and solve my problem

I have removed

apply plugin: 'com.neenbedankt.android-apt'

and changed Dagger library code

compile 'com.google.dagger:dagger:2.7'

annotationProcessor 'com.google.dagger:dagger-compiler:2.7'

provided 'org.glassfish:javax.annotation:10.0-b28'

Dhaval Jivani
  • 9,467
  • 2
  • 48
  • 42
-4

Temporaral fix that worked for me: 1. Change gradle version to: classpath 'com.android.tools.build:gradle:2.2.2'

  1. Turn off instant run

  2. Wait for an update from Google :)

Andrii Kovalchuk
  • 4,351
  • 2
  • 36
  • 31