欢迎来到苗小源的微博

爱生活,爱代码

Error:Execution failed for task ':app:javaPreCompileDebug' 报错!

报错原因:

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



        解决方案: 这个问题说明你在集成    butterknife 出错了

        在你的build.gradle添加如下代码

android {
    compileSdkVersion 26
    defaultConfig {
        applicationId "com.example.administrator.pandechinalive"
        minSdkVersion 16
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        //添加如下配置就OK了
        javaCompileOptions { annotationProcessorOptions { includeCompileClasspath = true } }
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}




阅读更多
个人分类: Android
上一篇Android属性动画
下一篇Android跳转到应用商店的APP详情页面
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

关闭
关闭