【发布时间】:2018-10-12 17:39:44
【问题描述】:
在我的应用模块的 build.gradle 中,我添加了
dependencies {
kapt('com.android.databinding:compiler:3.1.2')
...
}
但我仍然收到
的编译器警告app: 'annotationProcessor' dependencies won't be recognized as kapt annotation processors. Please change the configuration name to 'kapt' for these artifacts: 'com.android.databinding:compiler:3.1.2'.
一切正常,我只是讨厌到处出现警告。
非常感谢任何帮助!
【问题讨论】:
-
你还有其他使用annotationProcessor的依赖吗?
-
在我的 build.gradle 中,所有其他依赖项都是“implementation”、“testImplementation”或“androidTestImplementation”。我不知道我拥有的第 3 方依赖项是否正在使用注释处理。
-
这里有同样的问题。另外我得到这个错误: e: java.util.ServiceConfigurationError: javax.annotation.processing.Processor: android.databinding.annotationprocessor.ProcessDataBinding Unable to get public no-arg constructor
-
kapt用于 kotlin,annotationProcessor用于 java 代码 -
@RyanAmaral,我知道这一点,并在我的 build.gradle(上图)中使用 kapt,但仍然收到警告
标签: android kotlin annotation-processing kapt