当我更新关于android apt的gradle时,我最初有一个gradle错误。我上网并用谷歌搜索出了什么问题。我读到apt不再受支持了,我相应地迁移了我的代码然后去重建。
然而,即使在迁移我的代码并删除所有android apt代码并将其转换为注释后,我现在也收到此错误
Error:android-apt plugin is incompatible with the Android Gradle plugin. Please use 'annotationProcessor' configuration instead.
这是该模块的build.gradle
文件:
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
apply plugin: 'realm-android'
//apply plugin: 'me.tatarka.retrolambda'
// Manifest version information!
def versionMajor = 0
def versionMinor = 1
def versionPatch = 0
def versionBuild = 11 // bump for dogfood builds, public betas, etc.
android {
compileSdkVersion rootProject.compileSdkVersion
buildToolsVersion rootProject.buildToolsVersion
lintOptions {
abortOnError false
}
dexOptions {
javaMaxHeapSize "4g"
}
defaultConfig {
applicationId "com.ltst.schoolapp.teacher"
minSdkVersion rootProject.minSdkVersion
targetSdkVersion rootProject.targetSdkVersion
versionCode versionMajor * 10000 + versionMinor * 1000 + versionPatch * 100 + versionBuild
versionName "${versionMajor}.${versionMinor}.${versionPatch}"
multiDexEnabled true
}
signingConfigs {
release {
storeFile file('../teacher/distribution/schoolappteacher.keystore')
storePassword "LtStSchoolappTeacher"
keyAlias "teacherreleasekey"
keyPassword "UgoTeacher"
}
}
buildTypes {
debug {
applicationIdSuffix '.dev'
versionNameSuffix '-dev'
debuggable true
}
release {
debuggable false
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
buildToolsVersion '26.0.2'
}
repositories {
maven {
url 'https://github.com/uPhyca/stetho-realm/raw/master/maven-repo'
}
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:24.0.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.2.1'
annotationProcessor 'com.github.hotchemi:permissionsdispatcher-processor:2.1.3'
compile 'com.uphyca:stetho_realm:0.9.0'
compile 'com.github.thorbenprimke:realm-recyclerview:0.9.23'
compile('com.crashlytics.sdk.android:crashlytics:2.6.7@aar') {
transitive = true
}
implementation project(path: ':core')
// compile 'com.layer.sdk:layer-sdk:0.20.3'
// compile 'com.google.android.gms:play-services-gcm:7.5.0'
// compile 'org.slf4j:slf4j-nop:1.5.8'
}
android.applicationVariants.all { variant ->
variant.outputs.each { output ->
def outputFile = output.outputFile
if (outputFile != null && outputFile.name.endsWith('.apk'))
output.outputFileName = "schoolapp-teacher-${output.name}.apk"
}
}
apply plugin: 'com.google.gms.google-services'