Error:Annotation processors must be explicitly declared now.


环境

Android Studio 3.0
Gradle 3.0.0 
gradle 4.1

Error

   Error:Execution failed for task ':app:javaPreCompileAnzhiDebug'.
    > 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.

解决

javaCompileOptions {
        // 显式声明支持注解
        annotationProcessorOptions {
            includeCompileClasspath false
        }
}


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM