Android 错误:任务“:app:javaPreCompileDebug”的执行失败。安卓3.0+龙目岛
我想在Android Studio 3.0中使用lombok 我犯了一个错误Android 错误:任务“:app:javaPreCompileDebug”的执行失败。安卓3.0+龙目岛,android,gradle,lombok,android-studio-3.0,Android,Gradle,Lombok,Android Studio 3.0,我想在Android Studio 3.0中使用lombok 我犯了一个错误 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 proces
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.
- 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.
我的梯度依赖
compileOnly "org.projectlombok:lombok:1.16.18"
试一试
您可以通过在项目的一个顶级目录中的lombok.config文件中放置以下行来禁用javax.annotation.Generated的生成:
lombok.addGeneratedAnnotation = false
有关详细信息,请参阅。Ok您是否尝试过:编译'org.projectlombok:lombok:1.16.18'注释处理器org.projectlombok:lombok:1.16.18是。但是我得到了错误-错误:19,1错误:包javax.annotation不存在那么这应该可以工作:compileOnly'javax.annotation:javax.annotation api:1.2'compileOnly org.projectlombok:lombok:1.16.18 annotationProcessor org.projectlombok:lombok:1.16.18
lombok.addGeneratedAnnotation = false