java - Android Studio中执行aapt失败

标签 java android android-studio android-styles

Here are my Error Logs

我尝试过无效并重新启动,但没有成功。 这是我更新 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/

相关文章:

java - 为什么 v != null ? v++ : 1 is not the same as (v ! = 空? v : 0) + 1 on incrementing a key on HashMap. 计算?

java - SwingWorker 应该在类中的哪个位置

Android如何设置view的宽度与屏幕宽度成一定比例?

android - 在 Android Studio 中添加外部库

java - JSoup 不加载整个 HTML

android - 从 ListView 中获取文本

android - Android StackView 是什么样子的?

java - 尽管声明了字符串,但 OnClickListener 错误 : "[..] invoke virtual method [...] on a null object reference",

android - 如何向另一个 Activity 显示消息和照片

java - 用于任意 XML 的 JAXB @XmlAdapter