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

androidstudio3.1.2使用butterknife报错解决

android admin 6年前 (2018-05-07) 3531次浏览 已收录 扫描二维码
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全栈开发、项目管理,持续不断的学习、努力成为一个更棒的开发,做最好的自己,让世界因你不同。