![]() |
![]() |
||||||
Please add them to the annotationProcessor configuration. - butterknife-5.1.1.jar android studio 3.0错误 |
||||||
发布时间: 2018-01-15 |
浏览次数: 783
|
|||||
发布人: |
东川供求信息 |
Error:Execution failed for task ':aT:javaPreCompileDebug'.
> Annotation processors must now be declared explicitly. The following dependencies in the compile classpath are found to contain annotation processors. Please add them to the annotationProcessor configuration.
- butterknife-5.1.1.jar
Alternatively, set android.defaultConfig.javaCompileOptions.annotationProcessorOptions.includeCompileClasspath = true to continue with the previous behavior. Note that this option is deprecated and will be removed in the future.
See https://developer.android.com/r/tools/annotation-processor-error-message.html for more details.
经过排查,发现是Gradle引发的异常,这里大体说明下:
新的 gradle 插件不再支持 annotation processors,如果需要使用需要显式声明
So,解决办法如下:
defaultConfig {
...
ndk {
// 设置支持的SO库架构(开发者可以根据需要,选择一个或多个平台的so)
abiFilters "armeabi", "arm64-v8a"
}
javaCompileOptions {
// 显式声明支持注解
annotationProcessorOptions {
includeCompileClasspath false
}
}
}