android - 升级到 Android Studio 2.3 后 android-apt 的插件不兼容

标签 android android-studio gradle android-apt

从 2.2 升级到 2.3 后,我看到了这个警告

enter image description here

当我尝试编译项目时,我看到了这个编译错误

enter image description here

如何在不降级到以前的 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 and testApt 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/

相关文章:

php - 用php在android中使用websocket实现聊天

java - View 的行为是固定大小的,而不是使用 ConstraintLayout 基于屏幕的动态大小

android - Flutter IntelliJ 插件中没有控制台输出?

java - 如何修复 Gradle 同步失败 "Plugin with id ' com.android.application' 未找到”?

gradle - 在 Gradle 构建中处理依赖项中缺少的配置

android-studio - jitpack.io 依赖项不起作用

android - INSTALL_FAILED_MISSING_SHARED_LIBRARY 安卓模拟器问题

android - SCREEN_BRIGHTNESS_MODE 不适用于许可

android - 如何在 Kotlin 中将 .apply 中的重复语句分组?

Android studio 重构失败(只读)