gpt4 book ai didi

Android Studio 3.0 警告 : Using incompatible plugins for the annotation processing

转载 作者:搜寻专家 更新时间:2023-11-01 09:31:03 24 4
gpt4 key购买 nike

将 Android Studio 更新到 3.0 版本后我有警告:

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

我试图重写我的 gradle 源代码,但我仍然收到警告。这是一个来源

buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0'
classpath 'io.realm:realm-gradle-plugin:0.89.+'
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}




apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.syncapp"
minSdkVersion 21
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
testImplementation 'junit:junit:4.11'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
implementation 'com.android.support:support-v4:27.0.1'
implementation 'com.android.support:appcompat-v7:27.0.1'
implementation 'com.android.support:design:27.0.1'
compile 'org.greenrobot:eventbus:3.1.1'
compile 'com.google.code.gson:gson:2.6.2'
compile 'com.squareup.retrofit2:retrofit:2.1.0'
compile 'com.squareup.retrofit2:converter-gson:2.1.0'

compile 'com.squareup.okhttp:okhttp:2.7.5'
compile 'com.squareup.okhttp:mockwebserver:2.7.5'

compile 'com.jakewharton:butterknife:8.8.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'

compile 'com.google.dagger:dagger:2.4'
annotationProcessor 'com.google.dagger:dagger-compiler:2.4'


}
apply plugin: 'realm-android'

如您所见,在我的项目中,我使用了 butterknife、dagger、okhttp、retrofit2 和 eventbus 支持库

有什么解决办法吗?我无法运行我的应用程序谢谢

最佳答案

build.gradle 文件中删除 apt 插件。在任何你使用 apt 的依赖项中,将其替换为 annotationProcessor。此外,还将您的 realm 依赖项版本更新为 4.1.1

关于Android Studio 3.0 警告 : Using incompatible plugins for the annotation processing,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47329164/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com