Error:Execution failed for task ':laMusique2May2016: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.
- auto-value-1.1.jar (com.google.auto.value:auto-value:1.1)
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.我看到了这个问题,但问题是自动值-1.1.jar不在我的gradle文件中
发布于 2017-10-27 01:26:29
您应该显式地在gradle中添加注释处理器。将以下内容放在您的gradle依赖项中应该会修复它:
annotationProcessor 'com.google.auto.value:auto-value:1.1'但是,正如其他人已经提到的,您可能应该知道您现有的依赖项中有哪些是使用自动值来断言您是否真的需要它。注释处理器最终会减慢您的构建时间,因此如果没有必要,就不要包含它。
发布于 2018-02-09 07:36:33
甚至我也有同样的问题,最后我通过将这个添加到应用程序级别的gradle文件来解决我的问题。
android{
....
defaultConfig{
....
javaCompileOptions {
annotationProcessorOptions {
includeCompileClasspath true
}
}
}
buildTypes {
...
}希望它能解决某人的问题
发布于 2018-06-06 04:43:45
添加annotationProcessor依赖项对我不起作用,相反,我把这行放在build.gradle中的任意位置工作:
android.defaultConfig.javaCompileOptions.annotationProcessorOptions.includeCompileClasspath = true
https://stackoverflow.com/questions/46963498
复制相似问题