今天跑一个项目的时候,运行报错:
Annotation processors must be explicitly declared now. The following dependencies on the compile classpath are found to contain annotation processor. Please add them to the annotationProcessor configuration.
- butterknife-7.0.1.jar (butterknife-7.0.1.jar)
原因:
部分插件在Android Stduio3.0上不兼容注解,新gradle 插件不再支持 annotation processors,如果需要使用需要显式声明
解决方案:
在build.gradle文件中显式声明
android {
//...
defaultConfig {
//...
javaCompileOptions {
// 显式声明支持注解
annotationProcessorOptions {
includeCompileClasspath true
}
}
}
}