从 2.2 升级到 2.3 后,我看到了这个警告
当我尝试编译项目时,我看到了这个编译错误
如何在不降级到以前的 gradle 版本的情况下解决此问题? android-apt 有什么更新可以解决这个问题吗?
最佳答案
android-apt
插件已被弃用。
在这里查看 migration guide :
As of the Android Gradle plugin version 2.2, all functionality that was previously provided by android-apt is now available in the Android plugin.
您可以按照迁移指南移除 android-apt
以获得等效功能。
迁移指南中的重要部分:
- Make sure you are on the Android Gradle 2.2 plugin or newer.
- Remove the
android-apt
plugin from your build scripts- Change all
apt
,androidTestApt
andtestApt
dependencies to their new format:
dependencies {
compile 'com.google.dagger:dagger:2.0'
annotationProcessor 'com.google.dagger:dagger-compiler:2.0'
}
在 Android Gradle 插件中也有一个明确的检查,这就是你所看到的:
using incompatible plugins for the annotation processing android-apt
future 的 Android Gradle 插件版本将不兼容与 android-apt
的工作方式,这就是检查的原因。
关于android - 升级到 Android Studio 2.3 后 android-apt 的插件不兼容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42574803/