• 欢迎访问少将全栈,学会感恩,乐于付出,珍惜缘份,成就彼此、推荐使用最新版火狐浏览器和Chrome浏览器访问本网站。
  • 吐槽,投稿,删稿,交个朋友,商务沟通v:ai_draw
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏少将全栈吧

androidstudio3.1.2使用butterknife报错解决

android admin 6年前 (2018-05-07) 3422次浏览 已收录 1个评论 扫描二维码
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
  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.

在build.gradle(app)下增加如下配置

android {
    ...
    defaultConfig {
        ...
        javaCompileOptions {
            annotationProcessorOptions {
                includeCompileClasspath = true  
            }
        }
    }
}

具体如下:

android {
 compileSdkVersion 23
 buildToolsVersion '27.0.3'

 defaultConfig {
 applicationId "com.whatled.demo"
 minSdkVersion 11
 targetSdkVersion 23
 versionCode 1
 versionName "1.0"
 javaCompileOptions {
 annotationProcessorOptions {
 includeCompileClasspath = true
 }
 }
 }
 buildTypes {
 release {
 minifyEnabled false
 proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
 }
 }
}
}
喜欢 (3)
[🍬谢谢你请我吃糖果🍬🍬~]
分享 (0)
关于作者:
少将,关注Web全栈开发、项目管理,持续不断的学习、努力成为一个更棒的开发,做最好的自己,让世界因你不同。
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
(1)个小伙伴在吐槽
  1. 签到成功!签到时间:2020-06-03 12:59:24,每日打卡,生活更精彩哦~
    sdf9ds8f2020-06-03 12:59 回复 Windows 7 | Chrome 78.0.3904.108