我正在通过firebase进行身份验证,因为当我添加implementation 'com.firebaseui:firebase-ui-auth:3.3.0'
同步AAPT2 error: check logs for details
gradle后出现错误。这是我的 build.gradle 文件。
构建.gradle(应用程序)
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
以及如何发生。