我是 Android 开发的新手,并且有一个遗留项目。所以我安装了最新版本的 Android Studio 并打开它。
当我尝试构建它时,我收到此错误:
Error:android-apt plugin is incompatible with the Android Gradle plugin. Please use 'annotationProcessor' configuration instead.
我已经尝试了这些线程中显示的解决方案,但没有奏效。
我的 Grandle 构建脚本上没有任何 android-apt 参考。
许多编译包显示为已过时。但是当我按照 Android 的工作室建议更新参考时,我收到错误说找不到包。
正如我所说,我是 Android Studio World 的新手,所以我对所有这些东西有点迷茫。
这是我的 build.gradle(模块:app):
apply plugin: 'com.android.application'
apply plugin: 'me.tatarka.retrolambda'
apply plugin: 'realm-android'
android {
compileSdkVersion 24
buildToolsVersion "24.0.2"
defaultConfig {
applicationId "xxxxxxxxxxxx"
minSdkVersion 19
targetSdkVersion 24
versionCode 123
versionName "1.2.3"
manifestPlaceholders = [HOCKEYAPP_APP_ID: "xxxxxxxxxxxxxxxxxxxxx"]
//For Test
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
packagingOptions {
exclude 'META-INF/services/javax.annotation.processing.Processor'
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile('com.mikepenz:materialdrawer:4.6.4@aar') {
transitive = true
}
//For Test
androidTestCompile 'com.android.support:support-annotations:24.2.1'
//noinspection GradleCompatible
androidTestCompile 'com.android.support.test:runner:0.5'
androidTestCompile 'com.android.support.test:rules:0.5'
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2'
compile 'com.android.support:appcompat-v7:24.2.1'
compile 'com.android.support:design:24.2.1'
compile 'com.android.support:cardview-v7:24.2.1'
compile 'com.android.support:recyclerview-v7:24.2.1'
compile 'com.android.support:support-v4:24.2.1'
compile 'com.android.support:support-v13:24.2.1'
compile 'com.squareup.retrofit2:retrofit:2.0.0-beta4'
compile 'com.squareup.retrofit2:converter-gson:2.0.0-beta4'
compile 'com.squareup.okhttp3:okhttp:3.1.2'
compile 'com.jakewharton:butterknife:7.0.1'
compile 'com.p_v:flexiblecalendar:1.1.4'
compile 'br.com.zbra:android-linq:1.0.1'
compile 'com.google.android.gms:play-services-maps:9.4.0'
compile 'com.github.PhilJay:MPAndroidChart:v2.1.6'
compile 'com.cardiomood.android:android-widgets:0.1.1'
compile 'com.github.thorbenprimke:realm-recyclerview:0.9.14'
compile 'net.hockeyapp.android:HockeySDK:4.0.0'
}
这是我的 build.gradle(项目:MyApp):
buildscript {
repositories {
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'me.tatarka:gradle-retrolambda:3.2.3'
classpath "io.realm:realm-gradle-plugin:0.88.3"
}
}
allprojects {
repositories {
jcenter()
mavenCentral()
maven { url "https://jitpack.io" }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}