user9353624
user9353624

Reputation:

Failed to execute aapt in Android Studio

Here are my Error Logs

I've tried invalidate and restart but that didn't work. This happened after I updated Android Studio. I can clean my project and rebuild it successfully, but when I run it, I get the errors.

Additionally info that might not be the cause: I do get in an error in my styles.xml that "Theme" cannot be resolve to a symbol, However, it never gave me errors when I rebuild the project. My styles.xml

My app 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'

My Project 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
}

Upvotes: 0

Views: 6489

Answers (1)

Dorian
Dorian

Reputation: 23939

it's a bug in gradle code calling AAPT1. Remove android.enableAapt2=false and it should be fixed.

More info: Failed to execute aapt (NoSuchElementException at AbstractIndexedListIterator.next(AbstractIndexedListIterator.java:80)

Upvotes: 1

Related Questions