导入项目时,发现之前项目的butter knife报错,用到注解的应该都会报错
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.
- butterknife-7.0.1.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.
在app的build中
android {
...
defaultConfig {
...
//添加如下配置就OK了
javaCompileOptions { annotationProcessorOptions { includeCompileClasspath = true } }
}
...
}
继续阅读与本文标签相同的文章
远离神经网络这个黑盒,人工智能不止这一条路可走
-
面对人工智能的发展,人类未来将扮演怎样的角色?
2026-05-19栏目: 教程
-
2019 DevOps 必备面试题——持续集成篇
2026-05-19栏目: 教程
-
从“人工智障”到“人工智能”,Siri开始说人话了!
2026-05-19栏目: 教程
-
Flink 1.9 实战:使用 SQL 读取 Kafka 并写入 MySQL | 9月4号栖夜读
2026-05-19栏目: 教程
-
历时五天用 SwiftUI 做了一款 APP,阿里工程师如何做的?
2026-05-19栏目: 教程
