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
        }
}

猜你喜欢

转载自www.cnblogs.com/lifan1998/p/9220931.html