TJBlack31
TJBlack31

Reputation: 785

Android - android-apt plugin is incompatible with the Android Gradle plugin.

I'm in the process of getting this project up to par since the Gradle update. This is a team project and it was using the android-apt plugin. I've gone through and made the necessary syntax changes (compile --> implementation & apt --> annotation processor) but the compiler is still telling me there is a discrepancy:

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

Anyone have any ideas?

Thank you for any insights

-T

buildscript {
repositories {
    jcenter()
    mavenCentral()
    google()
}
dependencies {
    classpath 'com.android.tools.build:gradle:3.1.3'
    classpath 'com.neenbedankt.gradle.plugins:android-apt:1.4'
}
}

apply plugin: 'com.android.application'
apply plugin: 'android-apt'
def AAVersion = '4.0.0'
def JacksonVersion = '2.6.0'
def GPSVersion = '6.5.87'

dependencies {
implementation 'com.android.support:appcompat-v7:23.0.0'
implementation 'com.android.support:design:23.0.0'
implementation 'com.android.support:recyclerview-v7:23.0.0'
implementation 'com.android.support:preference-v7:23.0.0'

implementation "com.google.android.gms:play-services-maps:$GPSVersion"
implementation "com.google.android.gms:play-services-location:$GPSVersion"

implementation 'com.facebook.android:facebook-android-sdk:4.5.0'

annotationProcessor "org.androidannotations:androidannotations:$AAVersion"
annotationProcessor "org.androidannotations:rest-spring:$AAVersion"
implementation "org.androidannotations:androidannotations-api:$AAVersion"
implementation "org.androidannotations:rest-spring-api:$AAVersion"

implementation 'org.springframework.android:spring-android-rest-template:2.0.0.M3'

}
repositories {
maven {
    url 'https://repo.spring.io/libs-milestone'
}
}

apt {
arguments {
    androidManifestFile variant.outputs[0].processResources.manifestFile
    resourcePackageName "app"
    logLevel 'TRACE'
    logAppenderConsole 'true'
}
}

android {
compileSdkVersion 23
buildToolsVersion '27.0.3'

defaultConfig {
    applicationId "app"
    minSdkVersion 14
    targetSdkVersion 23
    versionCode 1
    versionName "1.0"
}
buildTypes {
    release {
        shrinkResources false
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
packagingOptions {
    exclude 'META-INF/notice.txt'
    exclude 'META-INF/license.txt'
    exclude 'META-INF/ASL2.0'
    exclude 'META-INF/LICENSE'
    exclude 'META-INF/NOTICE'
}
}

allprojects {
repositories {
    jcenter()
    mavenCentral()
    google()
}
}

Upvotes: 1

Views: 962

Answers (1)

Amit K. Saha
Amit K. Saha

Reputation: 5951

Try removing -

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

and

apply plugin: 'android-apt'

Annotation Processing became available in Android Gradle plugin (2.2 and later) so there is now no need / reason to provide an extra one.

Upvotes: 2

Related Questions