今天早上一上班打开Android Studio就把它更新到3.0,但是各种更新之后发现项目不能运行了,查看了一下,打印的错误是:
Error:A problem occurred configuring project ':app'.
> android-apt plugin is incompatible with the Android Gradle plugin. Please use 'annotationProcessor' configuration instead.
错误截图:
问题就出在butterknife,解决办法:
1、在project中的app文件的build.gradle文件里删除
apply plugin: 'com.neenbedankt.android-apt'
2、接着把buildscript的dependencies中删掉
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
3、最后把dependencies中的替换掉
// apt 'com.jakewharton:butterknife-compiler:8.0.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.0.1'