收到错误消息:android-apt插件与Android Gradle插件不兼容。请改用“ annotationProcessor”配置

时间:2018-10-01 04:16:57

标签: android android-studio

我收到此错误:

  

android-apt插件与Android Gradle插件不兼容。请改为使用“ annotationProcessor”配置

因为我无法使用它:

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'

1 个答案:

答案 0 :(得分:0)

我面临着同样的问题。此错误是由于领域插件依赖性引起的。请更新到最新版本的插件。我已将gradle.build中的领域依赖关系更新为此

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

并且错误已被删除。