【发布时间】:2018-01-20 05:32:06
【问题描述】:
我遇到了一个错误:android-apt 插件与 Android Gradle 插件不兼容。请改用“annotationProcessor”配置,我使用的是 Android Studio 3.0.1,并且使用了可能 2 或 3 年的 Android Studio 项目,我已经尝试了所有方法,但找不到解决方案。 虽然已经搜索了整个网络但仍然没有运气解决它,而且我在 build.gradle 中的代码上没有看到任何 android-apt 插件
Build.Gradle 代码
apply plugin: 'com.android.application'
apply plugin: 'realm-android'
android {
compileSdkVersion 24
buildToolsVersion '26.0.2'
defaultConfig {
applicationId "com.app.baryalitob"
minSdkVersion 14
targetSdkVersion 24
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
/* IMPORTANT :
* Be careful when update dependencies, different version library may caused error */
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
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'
【问题讨论】:
-
android-apt 在 android studio 3 中已弃用,您必须移动 annotationProcessor。检查这个developer.android.com/studio/build/…
-
谢谢老兄让我检查一下。
标签: javascript java android