简体   繁体   中英

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

As per this answer and this answer I already make changes in app gradle but still it is showing me following error while building my application.

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

What am I missing here?

Here is my App Gradle

buildscript {
    repositories {
        maven { url 'https://maven.fabric.io/public' }
    }

    dependencies {
        classpath 'io.fabric.tools:gradle:1.+'
    }
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
apply plugin: 'realm-android'



//project.ext.versionInfo.releaseVersionName = SYNCED_VERSION_NAME

android {
    compileSdkVersion 23
    flavorDimensions "default"
    defaultConfig {
        applicationId "in.something"
        minSdkVersion 15
        targetSdkVersion 23
        versionCode 13
        versionName "1.10"
       multiDexEnabled true

       }
    productFlavors {
        LIVE_BETA {
            applicationIdSuffix ".beta"
            resValue "string", "app_display_name", "Something(B)"
            resValue "string", "SERVER_URL", "http://something/beta"

        }

        LIVE {
            resValue "string", "app_display_name", "something"
            resValue "string", "SERVER_URL", "http://something/live"

        }

        DEV {
            applicationIdSuffix ".dev"
            resValue "string", "app_display_name", "something(D)"
            resValue "string", "SERVER_URL", "http://localhost/"
        }
    }
    buildTypes {
        debug {
//            applicationIdSuffix "
// .debug"
//            versionNameSuffix "-debug"
        }

        release {
            //minifyEnabled true
            //shrinkResources true
        }
    }
    packagingOptions {
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/NOTICE'
    }
    // Rename APK files
//    applicationVariants.all { variant ->
//        def output = variant.outputs.get(0)
//        File apk = output.outputFile
//        String newName = output.outputFile.name.replace(".apk", "-${variant.mergedFlavor.versionCode}-${variant.mergedFlavor.versionName}-.apk")
//                .replace("app-", "${variant.mergedFlavor.applicationId}-")
//        output.outputFile = new File(apk.parentFile, newName)
//    }
}


repositories {
    jcenter()
    mavenCentral()
    maven { url 'https://maven.fabric.io/public' }
}



dependencies {
    //================== Local ========================/
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    //compile files('libs/ksoap2-android-assembly-3.1.1-jar-with-dependencies.jar')
    /** *************************************************/
    //================== Default ========================/
    implementation 'com.android.support:appcompat-v7:23.1.0'
    implementation 'com.android.support:recyclerview-v7:23.1.0'
    implementation 'com.android.support:design:23.1.0'
    implementation 'com.android.support:cardview-v7:23.1.0'
    /** *************************************************/
    implementation 'com.fasterxml.jackson.core:jackson-databind:2.6.3'
    implementation 'com.fasterxml.jackson.core:jackson-core:2.6.3'
    implementation 'com.fasterxml.jackson.core:jackson-annotations:2.6.3'
    //implementation files('libs/bouncycastle-java5-136-1.0.0.jar')
    implementation 'com.joanzapata.iconify:android-iconify-fontawesome:2.1.1'

    /************  Location *****************/
    implementation 'com.google.android.gms:play-services-location:8.3.0'

    /** *************************************************/
    /************  Common *****************/
    implementation 'commons-io:commons-io:2.4'
    implementation 'commons-codec:commons-codec:1.4'
    /** ********************************/
    implementation('com.crashlytics.sdk.android:crashlytics:2.5.5@aar') {
        transitive = true;
    }
    implementation files('libs/bouncycastle-java5-136-1.0.0.jar')

}

I am using Android Studio 3.0 and gradle version is 3.0

And add below your

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

definition

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

For me it looks like it was upgrading Realm from

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

to

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM