我想在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 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.
我的gradle依赖
compileOnly "org.projectlombok:lombok:1.16.18"
答案 0 :(得分:1)
尝试
compile 'org.projectlombok:lombok:1.16.18' annotationProcessor "org.projectlombok:lombok:1.16.18"
您可以通过将以下行放入项目顶级目录之一的javax.annotation.Generated
文件中来禁用lombok.config
的生成:
lombok.addGeneratedAnnotation = false
有关详细信息,请参阅configuration documentation。