解决 android-apt plugin is incompatible with the Android Gradle plugin. Please use 'annotationProcesso
在使用EventBus 3.0或者butterknife的时候,在Android Studio 执行Sync Project的时候出现了这个错误
解决方案
先把项目根目录下的build.gradle中的classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8’删除,下面是完整的代码
buildscript {
repositories {
mavenCentral()
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
//step 1.需要把这段代码注释或者删除
//classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
}
}
allprojects {
repositories {
mavenCentral()
jcenter()
google()
}
}
然后导入新的butterknife的,以
api 'com.jakewharton:butterknife:8.8.1'
annotationProcessor 'com.jakewharton:butterknife-apir:8.8.1'