【发布时间】:2020-08-31 15:19:01
【问题描述】:
我有一个包含多个库模块的大型 Android 项目。他们都使用 Kotlin,而且很多都启用了数据绑定。项目和所有模块都可以正常构建和运行,没有错误。
但是,我在 Gradle 同步日志中收到了我认为是误报的每个模块的警告:
> Configure project :feature-a
Kotlin plugin is applied to the project :feature-a but we cannot find the KaptTask. Make sure you apply the kotlin-kapt plugin because it is necessary to use kotlin with data binding.
> Configure project :feature-b
Kotlin plugin is applied to the project :feature-b but we cannot find the KaptTask. Make sure you apply the kotlin-kapt plugin because it is necessary to use kotlin with data binding.
> Configure project :feature-c
Kotlin plugin is applied to the project :feature-c but we cannot find the KaptTask. Make sure you apply the kotlin-kapt plugin because it is necessary to use kotlin with data binding.
[... etc. for dozens of modules ...]
我已检查以确保正确应用了“kotlin-kapt”插件。我正在为所有模块使用 Kotlin Gradle DSL,并且正在应用这样的插件:
plugins {
id("com.android.library")
id("kotlin-android")
id("kotlin-android-extensions")
id("kotlin-kapt")
id("androidx.navigation.safeargs.kotlin")
}
是什么导致了这个警告,它实际上是一个问题,我如何让它消失?
【问题讨论】:
标签: android android-databinding