本文主要是介绍解决:ButterKnife在gradle 3.0以后用不了的情况,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
今天看着项目,想着使用黄油刀省点事儿,配置好黄油刀之后,悠哉的点击了一下运行,突然报了一个异常,如下:
Error:java.lang.RuntimeException: 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.
经过排查,发现是Gradle引发的异常,这里大体说明下:
新的 gradle 插件不再支持 annotation processors,如果需要使用需要显式声明
So,解决办法如下:
defaultConfig {...javaCompileOptions {// 显式声明支持注解annotationProcessorOptions {includeCompileClasspath true}}
}
原博主之前写的配置是
includeCompileClasspath false
这篇关于解决:ButterKnife在gradle 3.0以后用不了的情况的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!