【问题标题】:Failed to execute aapt in Android Studio在 Android Studio 中执行 aapt 失败
【发布时间】:2018-04-01 02:19:49
【问题描述】:

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
}

【问题讨论】:

  • 这可能会对您有所帮助:android.enableAapt2=false 将其添加到您的 gradle.properties 文件中。
  • 其实恰恰相反。 :) 删除 android.enableAapt2=false 将解决此问题。

标签: java android android-studio android-styles


【解决方案1】:

这是调用 AAPT1 的 gradle 代码中的错误。删除 android.enableAapt2=false 并且它应该被修复。

更多信息:无法执行 aapt(NoSuchElementException at AbstractIndexedListIterator.next(AbstractIndexedListIterator.java:80)

【讨论】:

    猜你喜欢
    • 2023-03-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-16
    • 1970-01-01
    • 2017-03-18
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多