我今天更新到 Android Studo 2.3 Canary 后遇到问题。
构建完成没有错误,但是当我运行应用程序时,gradle 控制台一直显示:
android.databinding.annotationprocessor.ProcessDataBinding 未找到
这是我的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
}
谢谢 !
---更新---我挣扎了几天,我发现问题出在哪里。我在我的应用程序中使用 Parcels、Retrolamdas,两个库都使用“apt”,这就是问题所在。
build.gradle (root) 错误版本:
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) 错误版本 **
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'
}
这里是固定的。 build.gradle (root) 固定版本:
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) 固定版本*
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'
结论。我更改了retrolamdas repo 版本并删除了插件:'android-apt'。如果您想了解详细信息,我发现了一些有用的链接。
https://github.com/johncarl81/parceler/issues/201 https://bitbucket.org/hvisser/android-apt/wiki/Migration
希望它有所帮助:D