我正在使用Gradle构建一个Android Studio项目。我在一个模块中使用了自动值,但是由于某种原因,任何高于1.5.3的自动值版本都会导致编译失败。
我在build.gradle中对模块的依赖性如下:
annotationProcessor 'com.google.auto.value:auto-value:1.5.3'
如果我只是将1.5.3更改为1.6.5,则在构建时会收到以下错误(同步工作正常):
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.
- auto-value-1.5.3.jar (com.google.auto.value:auto-value:1.5.3)
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.
我什至尝试使用documentation上的建议说明:
api "com.google.auto.value:auto-value-annotations:1.6.2"
annotationProcessor "com.google.auto.value:auto-value:1.6.2"
有什么线索在这里做什么?