Android Studio Warning: Using incompatible plugins for the annotation processing Android Studio Warning: Using incompatible plugins for the annotation processing android android

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


In my project I use, among other things, Butter Knife and Immutables. After adding Immutables I got the following warning

Warning:Using incompatible plugins for the annotation processing: android-apt. This may result in an unexpected behavior.

and ButterKnife stopped working.

My configuration was as follows:

build.gradle (Project: MyApplication)

buildscript {    repositories {        jcenter()    }    dependencies {        classpath 'com.android.tools.build:gradle:2.3.1'        classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'    }}

build.gradle (Module: app)

apply plugin: 'com.android.application'apply plugin: 'android-apt'...dependencies {    ...    // Butter Knife    compile 'com.jakewharton:butterknife:8.5.1'    annotationProcessor 'com.jakewharton:butterknife-compiler:8.5.1'    // Immutables    apt 'org.immutables:value:2.4.4'    provided 'org.immutables:value:2.4.4'    provided 'org.immutables:builder:2.4.4'    provided 'org.immutables:gson:2.4.4'}

After changing

annotationProcessor 'com.jakewharton:butterknife-compiler:8.5.1'

to

apt 'com.jakewharton:butterknife-compiler:8.5.1'

warning disappeared and everything works as it should.

UPDATE

As Mark said, an annotation processor was included in the Gradle version 2.2 , so there is no reason to provide an extra one.

So:

1) Remove the class path for the apt from the build.gradle (Project: MyApplication)

classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'

2) Remove the plug in from the build.gradle (Module: app)

apply plugin: 'android-apt'

3) Change the dependencies from apt to the new annotationProcessor

annotationProcessor 'com.jakewharton:butterknife-compiler:8.5.1'annotationProcessor 'org.immutables:value:2.4.4'


To add to @Milan's answer, if you used the hotchemi permissiondispatcher library in your app level gradle file then you should replace it as follows:

Replace

apt 'com.github.hotchemi:permissionsdispatcher-processor:2.4.0'

with

annotationProcessor 'com.github.hotchemi:permissionsdispatcher-processor:2.4.0'