Android3.0Butterknife出现错误解决

在androidstudiox3.0上依赖了butterknife7.0.1的版本,运行时出现了如下错误

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-7.0.1.jar (com.jakewharton:butterknife:7.0.1)

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.

这种的解决方案是:

在你module的build.gradle文件中添加如下代码即可


代码如下:

javaCompileOptions{

annotationProcessorOptions{

includeCompileClasspath=true

}

}

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • Android 自定义View的各种姿势1 Activity的显示之ViewRootImpl详解 Activity...
    passiontim阅读 176,449评论 25 709
  • 今天跟着米妮老师的水彩课,用新买的色粉做了练习。因为水彩的准备工作似乎要多些,而且笔也没买好,就勇于尝试一下吧。 ...
    骐彰阅读 4,662评论 2 4
  • 做人:内方外圆;做事:随方就圆。
    津渡_bee1阅读 1,355评论 0 0
  • 拿C段 看见了个很接近的C段并且是一个公司一般的企业的都挺好日的 218.x.241.134的第一个企业站点习惯性...
    Safesonic阅读 10,750评论 0 3
  • 今天给大学刚毕业的朋友打了电话,发现号码打不通了,才发现毕业都已经四个月了,我们好久都没联系了。他要结婚了,还好微...
    默默坚持努力的小青年阅读 1,324评论 0 0

友情链接更多精彩内容