Incompatible Plugins for Android-Apt After Upgrading to Android Studio 2.3

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

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 update : Warning:Using incompatible plugins for the annotation processing: android-apt. This may result in an unexpected behavior

Older versions of Realm use android-apt. You should upgrade your realm-android plugin version.

android-apt plugin is incompatible with the Android Gradle plugin. Please use 'annotationProcessor' configuration instead

And add below your

classpath 'io.fabric.tools:gradle:1.+'

definition

 classpath "io.realm:realm-gradle-plugin:4.1.1"

Android Studio 3.0 error: android-apt is incompatible

The third party android-apt plugin is no longer supported. You should switch to the built-in annotation processor support, which has been improved to handle resolving dependencies lazily.

When using the Android plugin 3.0.0, you must add annotation processors to the processor classpath using the annotationProcessor dependency configuration, as shown below:

dependencies {
...
annotationProcessor 'com.google.dagger:dagger-compiler:<version-number>'
}

Please read the full migration guide to Android Gradle Plugin 3.0.0 at https://developer.android.com/studio/build/gradle-plugin-3-0-0-migration.html


Retrolambda is no longer needed. New Android Gradle Plugin supports Java 8 language features. Read more here.


Assuming you followed the migration guide the error is caused by old Realm plugin.

Realm plugin manages all Realm dependencies behind the scenes. This also means that its old version does not support new tools.

annotationProcessor configuration is first supported in Realm 2.2.0 as seen in the changelog:

Enhancements

  • Added support for the annotationProcessor configuration provided by Android Gradle Plugin 2.2.0 or later. Realm plugin adds its annotation processor to the annotationProcessor configuration instead of apt configuration if it is available and the com.neenbedankt.android-apt plugin is not used. In Kotlin projects, kapt is used instead of the annotationProcessor configuration (#3026).

Actually you have two options:

  • update your Realm to at least 2.2.0, or
  • go back to Android Gradle Plugin 2.3.3.

Android Studio Warning: Using incompatible plugins for the annotation processing

Your app level gradle dependencies should include (as per butterknife website instructions):

compile 'com.jakewharton:butterknife:8.8.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'

You can remove the line :

apply plugin: 'com.neenbedankt.android-apt'

Annotation Processing became available in Android Gradle plugin (2.2 and later) so there is now no need to use the above plugin anymore if using this version of gradle or greater.

If you'd like to know how to turn annotation processing off and on and AS the setting is in :

Settings > Build, Execution, Deployment > Compiler > Annotation Processors

Can't build after updating to Android Studio 2.3

You can down version of tools build gradle from 2.3.0 to 2.2.3 to avoid warning like that

classpath 'com.android.tools.build:gradle:2.2.3'


Related Topics



Leave a reply



Submit