我使用了一些項目的龍目島,並與新的Android Studio的2.4更新,現在(預覽)我得到這個奇怪的錯誤:過Android Studio 2.4 +龍目島annotationProcessor配置混亂
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
有同樣的問題。我在一個Android lib模塊和一個Java lib模塊中使用了Lombok。我只需要更新Android模塊中的build.gradle。 Java模塊可以保留爲'compileOnly'org.projectlombok:lombok:[您的版本]「' – tir38
除了上面提供的/ annotationProcessor行之外,使用Android Studio 3.0 canary 1我還必須添加 javaCompileOptions註釋ProcessorOptions{ includeCompileClasspath =真 } }' 的 '機器人內部{ defaultConfig { } }'部分。 – DSoldo
'annotationProcessor'應該是'kapt' – Diolor