我尝试过无效并重新启动,但没有成功。 这是我更新 Android Studio 后发生的。 我可以清理我的项目并成功重建它,但是当我运行它时,我收到错误。
其他可能不是原因的信息: 我确实在 styles.xml 中遇到“主题”无法解析的错误 到一个符号,但是,当我重建时它从来没有给我错误 项目。 My styles.xml
我的应用程序 build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion '27.0.3'
defaultConfig {
applicationId "com.doggos.doggochat"
minSdkVersion 22
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true //important
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile 'com.firebase:firebase-client-android:2.5.2+'
compile 'com.android.volley:volley:1.0.0'
compile 'com.google.firebase:firebase-core:11.8.0'
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
}
apply plugin: 'com.google.gms.google-services'
我的项目build.gradle:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.0'
classpath 'com.google.gms:google-services:3.2.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
最佳答案
这是调用 AAPT1 的 gradle 代码中的错误。删除 android.enableAapt2=false 它应该被修复。
更多信息:无法执行 aapt(AbstractIndexedListIterator.next(AbstractIndexedListIterator.java:80) 处出现 NoSuchElementException
关于java - Android Studio中执行aapt失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49594207/