升级到 Android Studio 3.0 后,我遇到了一些 gradle 问题,我可以通过检查开发人员来修复这些问题website https://developer.android.com/studio/build/gradle-plugin-3-0-0-migration.html
但是,我无法找到如何解决该问题apply plugin: 'android-apt'
我尝试了几件事,例如将其从项目 gradle 中删除并将其添加到应用程序 gradle 中annotationProcessor 'com.neenbedankt.gradle.plugins:android-apt:1.8'
。还删除了 apt 等。
无论如何,Studio 都在抱怨。任何帮助是极大的赞赏。谢谢!
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
classpath 'com.google.gms:google-services:3.1.1'
}
}
allprojects {
repositories {
jcenter()
google()
maven { url "https://jitpack.io" }
}
ext {
supportLibVersion = '27.0.0'
firebaseLibVersion = '11.4.2'
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
应用程序等级
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
buildToolsVersion "27.0.0"
defaultConfig {
applicationId "xxxxxxxxxxxxxxxxxxxx"
minSdkVersion 17
targetSdkVersion 27
versionCode 1
versionName "1.0"
vectorDrawables.useSupportLibrary = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
apply plugin: 'android-apt'
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile "com.android.support:appcompat-v7:${supportLibVersion}"
.....
compile 'com.google.android.gms:play-services-auth:11.4.2'
compile 'com.jakewharton:butterknife:8.4.0'
apt 'com.jakewharton:butterknife-compiler:8.4.0'
}
apply plugin: 'com.google.gms.google-services'
不要使用 apt 插件,添加依赖项如下:
compile "com.jakewharton:butterknife:8.8.1"
annotationProcessor "com.jakewharton:butterknife-compiler:8.8.1"
参考 https://github.com/JakeWharton/butterknife
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)