【发布时间】:2018-09-17 08:18:31
【问题描述】:
自从我添加implementation 'com.firebaseui:firebase-ui-auth:3.3.0' 后,我正在通过firebase 进行身份验证,我在同步gradle 后收到AAPT2 error: check logs for details 错误。
这是我的 build.gradle 文件。
build.gradle(app)
apply plugin: 'com.android.application'
repositories {
mavenLocal()
flatDir {
dirs 'libs'
}
}
android {
compileSdkVersion 24
buildToolsVersion '27.0.3'
defaultConfig {
applicationId "com.google.firebase.udacity.friendlychat"
minSdkVersion 16
targetSdkVersion 24
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE-FIREBASE.txt'
exclude 'META-INF/NOTICE'
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
testImplementation 'junit:junit:4.12'
implementation 'com.android.support:design:24.2.1'
implementation 'com.android.support:appcompat-v7:24.2.1'
// Firebase
implementation 'com.google.firebase:firebase-database:12.0.1'
implementation 'com.firebaseui:firebase-ui-auth:3.3.0'
implementation 'com.google.firebase:firebase-auth:12.0.1'
// Displaying images
implementation 'com.github.bumptech.glide:glide:3.6.1'
}
apply plugin: 'com.google.gms.google-services'
还有 build.gradle(Project)
// Top-level build file where you can add configuration options common to
all sub-projects/modules.
buildscript {
repositories {
jcenter()
mavenLocal()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.0'
classpath 'com.google.gms:google-services:3.2.1' // google-services
plugin
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
mavenLocal()
maven {
url "https://maven.google.com" // Google's Maven repository
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
我删除此implementation 'com.firebaseui:firebase-ui-auth:3.3.0' 的那一刻,错误就消失了。我认为添加这个是在创建AAPT2 error。
Google SDK Tools、Google Repository 和 Google Play Services 也已安装。还请解释这是什么AAPT2 error,如果可能的话,这是如何发生的。
【问题讨论】:
-
在 gradle 控制台中运行 assembleDebug 以查找导致错误的特定行。
-
@Abhi 查看问题的编辑版本。我在那里提到了导致错误的行。
-
是否 assembleDebug 将该行作为错误原因?可能还有其他冲突的错误。
标签: android android-studio android-gradle-plugin android-studio-3.0 aapt2