升级到Android Studio 2.3后,针对android-apt的插件不兼容 [英] Incompatible plugins for android-apt after upgrading to Android Studio 2.3

查看:325
本文介绍了升级到Android Studio 2.3后,针对android-apt的插件不兼容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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



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



如何解决此问题而不降级到以前的gradle版本?
是否有更新的android-apt可以解决这个问题?

解决方案

android-apt plugin 已被弃用

请点击此处查看迁移指南


从Android Gradle插件2.2版开始,以前由android-apt提供的所有功能现已在Android插件中提供。


您可以删除 来自迁移指南的重要组成部分



  • 确保您使用的是Android Gradle 2.2插件或更新的版本。

  • 从构建脚本中移除 android-apt 插件

  • 更改所有 apt androidTestAp t 和 testApt 依赖关系转换为新格式:



 依赖关系{
编译'com.google.dagger:dagger:2.0'
annotationProcessor'com.google.dagger:dagger编译器:2.0'
}

在Android Gradle插件中还有一个明确的检查为此,您正在看到的是:


使用不兼容的插件进行注释处理android-apt


未来的Android Gradle插件版本与 android-apt 作品,这是检查的原因。


After upgrading from 2.2 to 2.3 I see this warning

and when I try to compile the project I see this compilation error

How can i solve this issue without downgrading to a previous gradle version? Is there any update of android-apt that can solve this issue?

解决方案

The android-apt plugin has been deprecated.
Check here for the 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.

You can remove android-apt by following the migration guide to get the equivalent functionalities.

The important parts from the migration guide:

  • 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'
}

Also in the Android Gradle plugin there is an explicit check for this, which is what you are seeing:

using incompatible plugins for the annotation processing android-apt

Future Android Gradle plugin versions will not be compatible with the way android-apt works, which is the reason for that check.

这篇关于升级到Android Studio 2.3后,针对android-apt的插件不兼容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆