set android.defaultConfig.javaCompileOptions.annotationProcessorOptions.includeCompileClasspath = t

在集成lomBok butterknife时 用到注解build报如下错误

 Error:FAILURE: Build failed with an exception.

* What went wrong:
    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.
    - lombok-1.16.18.jar (org.projectlombok:lombok:1.16.18)
    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.

            * Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

    BUILD FAILED in 4s 

解决:

在app的build中
android {
    ...
    defaultConfig {
        ...
        //添加如下配置就OK了
        javaCompileOptions { annotationProcessorOptions { includeCompileClasspath = true } }
    }
    ...
}

猜你喜欢

转载自blog.csdn.net/xuwb123xuwb/article/details/80949018
set