在我的应用模块的 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'.
一切正常,我只是讨厌到处出现警告。
非常感谢任何帮助!
最佳答案
在升级到最新的 Android Gradle 构建插件和 Kotlin 之前,我收到了同样的警告。现在他们走了。这是我使用的配置。
project.gradle
buildscript {
dependencies {
classpath "com.android.tools.build:gradle:3.1.3"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.2.51"
}
}
module.gradle
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
android {
...
dataBinding {
enabled = true
}
}
dependencies {
// no kapt declaration for databinding here
}
希望对你有帮助。
关于android - 数据绑定(bind)注释处理器 kapt 警告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50137564/