更新gradle 3以后,出现以下错误信息:
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 (com.jakewharton:
解决办法:
在defaultConfig配置里添加:
android {
...
defaultConfig {
javaCompileOptions {
annotationProcessorOptions {
includeCompileClasspath = true
}
}
}
}
本文解决了更新Gradle3后出现的“Annotationprocessorsmustbeexplicitlydeclarednow”错误。通过在defaultConfig中添加javaCompileOptions和annotationProcessorOptions配置,设置includeCompileClasspath为true,成功解决依赖项中的注解处理器未被正确识别的问题。
312





