简体   繁体   中英

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

I am getting this error:

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

Because I use this not working :

Android Studio Warning: Using incompatible plugins for the annotation processing

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

buildscript {
    repositories {
        jcenter()
        google()
    }
    dependencies {

        classpath 'com.android.tools.build:gradle:3.0.1'
        classpath "io.realm:realm-gradle-plugin:1.1.1"
        classpath 'com.google.gms:google-services:3.0.0'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

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

task clean(type: Delete) {
    delete rootProject.buildDir
}
apply plugin: 'com.android.application'
apply plugin: 'realm-android'

android {
    compileSdkVersion 24
    buildToolsVersion '27.0.3'
    defaultConfig {
        applicationId "com.queivera.manna"
        minSdkVersion 14
        targetSdkVersion 24
        versionCode 3
        versionName "1.3"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    productFlavors {
    }
}

/* IMPORTANT :
 * Be careful when update dependencies, different version library may caused error */
dependencies {

    compile fileTree(include: ['*.jar'], dir: 'libs')
    testCompile 'junit:junit:4.12'
    // google library

    compile 'com.android.support:appcompat-v7:24.1.1'
    compile 'com.android.support:cardview-v7:24.1.1'
    compile 'com.android.support:recyclerview-v7:24.1.1'
    compile 'com.android.support:design:24.1.1'
    compile 'com.android.support:support-v4:24.1.1'
    compile 'com.google.android.gms:play-services-ads:9.2.1'
    compile 'com.google.android.gms:play-services-analytics:9.2.1'
    compile 'com.google.firebase:firebase-messaging:9.2.1'
    // library for api
    compile('com.squareup.retrofit2:retrofit:2.0.0-beta4') {
        exclude module: 'okhttp'
    }
    compile 'com.squareup.okhttp3:okhttp:3.2.0'
    compile 'com.squareup.okhttp3:logging-interceptor:3.0.1'
    compile 'com.squareup.retrofit2:converter-gson:2.1.0'
    compile 'com.squareup.picasso:picasso:2.5.2'
    // ripple effect library
    compile 'com.balysv:material-ripple:1.0.2'
}

apply plugin: 'com.google.gms.google-services'

I was facing the same problem. this error is due to the realm plugin dependency. Please update to the latest version of the plugin . I have update the realm dependency in gradle.build to this one

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

and the error has been removed.

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