gpt4 book ai didi

Android Studio 2.4 + Lombok annotationProcessor 配置困惑

转载 作者:塔克拉玛干 更新时间:2023-11-02 22:24:23 27 4
gpt4 key购买 nike

我在一些项目上使用了 lombok,现在使用新的 Android Studio 2.4 更新(预览)我得到了这个奇怪的错误:

What went wrong: Execution failed for task ':core:javaPreCompileRelease'. 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.16.jar 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.

我已经试过了:

annotationProcessor "org.projectlombok:lombok:1.16.16"

但没有效果。

我也测试过:

android.defaultConfig.javaCompileOptions.annotationProcessorOptions.includeCompileClasspath = true

但是也没有效果。

还检查了支持页面以获取更多信息,但没有运气,你们中的任何人都可能吗? https://developer.android.com/studio/preview/features/index.html?utm_source=android-studio#annotationProcessor_config

最佳答案

更新:

provided "org.projectlombok:lombok:1.16.16" // keep
annotationProcessor "org.projectlombok:lombok:1.16.16" // add this

工作得很好,但我有两个 Android Studio 模块和两个 build.gradle 文件。错误日志只是改变了一点(模块前缀),我认为修复没有用。

但是在对两个 build.gradle 文件应用修复后,一切都运行良好。

关于Android Studio 2.4 + Lombok annotationProcessor 配置困惑,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43820372/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com