今天我将 Android Studio 从 2.3 更新到 3.0,Gradle 插件也更新了,但在我的这个项目中,它显示了这个错误(错误:android-apt 插件与 Android Gradle 插件不兼容。请改用“annotationProcessor”配置)。在我的 muild.gradle (Module:app) 下面,感谢您的帮助。
apply plugin: 'com.android.application'
apply plugin: 'com.neenbedankt.android-apt'
android {
compileSdkVersion 26
buildToolsVersion '26.0.2'
defaultConfig {
applicationId "com.tecnologias.uniagustapp"
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 {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:design:26.+'
compile 'com.android.support:design:26.+'
compile 'com.android.support:appcompat-v7:26.+'
compile 'com.android.support:support-v4:26.+'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:recyclerview-v7:26.+'
compile 'com.android.support:cardview-v7:26.+'
compile 'com.jakewharton:butterknife:8.4.0'
compile 'com.thoughtbot:expandablerecyclerview:1.3'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'de.hdodenhof:circleimageview:2.0.0'
testCompile 'junit:junit:4.12'
apt 'com.jakewharton:butterknife-compiler:8.4.0'
}
在以下链接中,您有从 apt 迁移到 annotationProcessor 的步骤
从 apt 到注解处理器
基本上:
我希望它有效。