Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
265 views
in Technique[技术] by (71.8m points)

Incompatible plugins for android-apt after upgrading to Android Studio 2.3

After upgrading from 2.2 to 2.3 I see this warning

enter image description here

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

enter image description here

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?

Question&Answers:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...