運(yùn)行項(xiàng)目的時候報了這個錯誤:
Error:Execution failed for task ':app:javaPreCompileDebug'.
> 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-6.1.0.jar (com.jakewharton:butterknife:6.1.0)
Alternatively, set android.defaultConfig.javaCompileOptions.annotationProcessorOptions.includeCompileClasspath = true to continue with 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.
原因:
使用注解編譯庫前酿,需要顯示的聲明熊户,而我正在使用的butterknife是含有注解編譯功能的,但是我的沒有聲明抓歼,所以導(dǎo)致變異錯誤垂涯。
解決辦法:
android {
defaultConfig {
// 聲明需要使用注解功能
javaCompileOptions { annotationProcessorOptions { includeCompileClasspath = true } }
...
}
}
作者:珠穆朗瑪小王子
鏈接:http://www.reibang.com/p/47bf8941c0ac
來源:簡書
著作權(quán)歸作者所有嵌巷。商業(yè)轉(zhuǎn)載請聯(lián)系作者獲得授權(quán)重窟,非商業(yè)轉(zhuǎn)載請注明出處鸟雏。