Android Studio gradle编译时出现如下错误:

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

解决方法:

 在app-->build.gradle中

     defaultConfig{

  .........

添加如下代码:

javaCompileOptions {    annotationProcessorOptions {        includeCompileClasspath = true    }

}

更多相关文章

  1. Android做了些什么?
  2. MIPS android 编译总结
  3. gradle 配置文件 build.gradle 属性详解
  4. Android(安卓)驱动开发文章收录
  5. andriod item内checked的setOnClickListener事件和setOnItemClic
  6. android圆形进度条ProgressBar颜色设置
  7. Android编译过程详解(一)
  8. Android(安卓)service
  9. Android(安卓)SDK Manager 报错:Connection to https://dl-ssl.go

随机推荐

  1. Kotlin 协程之三:Android中的应用
  2. 谈谈国内开发的Linux手机软件平台Broncho
  3. CSDN日报190718:史上最全的Android面试题
  4. Android(安卓)Studio增加assets目录、raw
  5. android webview与h5交互时所遇到的坑
  6. Android菜单系统介绍
  7. Android沉浸式状态栏(透明状态栏)最佳实
  8. 高仿android 版微信(服务端,客户端都有)
  9. Android---Activity初探
  10. Android(安卓)studio升级gradle4.x后自定