当前位置: 首页 > 知识库问答 >
问题:

获取错误:Android插件与Android渐变插件不兼容。请改用“注释处理器”配置

霍浩皛
2023-03-14

我收到此错误:

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

因为我用这个不工作:

Android Studio警告:使用不兼容的插件进行注释处理

升级到Android Studio 2.3后android-apt的不兼容插件

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个答案

萧宁
2023-03-14

我也面临同样的问题。这个错误是由于领域插件依赖性造成的。请更新到插件的最新版本。我已经更新了gradle中的领域依赖项。构建到这个

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

并且错误已被消除。

 类似资料: