报错:Error:android-apt plugin is incompatible with the Android Gradle plugin. Please use 'annotationP

在AndroidStudio更新到3.0之后发现上面的配置不能用了,这里记录下解决方法

首先把项目下的build.gradle中的classpath ‘com.neenbedankt.gradle.plugins:android-apt:1.8’删掉
把module下面的build.gradle最上面引入的插件删掉,不管是下面这两个中的哪一个,都删掉
apply plugin: ‘com.neenbedankt.android-apt’
apply plugin: ‘android-apt
在module下的build.gradle中的依赖修改为

// butterknife   组件注入
implementation 'com.jakewharton:butterknife:8.6.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.6.0'

猜你喜欢

转载自blog.csdn.net/yjh_SE007/article/details/79322660