0
votes

My build from jenkins failed and my error is :

FAILURE: Build failed with an exception.

What went wrong: Execution failed for task ':app:mergeDebugResources'. java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource compilation failed Output: C:\Windows\System32\config\systemprofile.gradle\caches\transforms-1\files-1.1\appcompat-v7-28.0.0.aar\469a8bd93b2c9fb2a42463f1ac0d81a5\res\layout\abc_action_bar_up_container.xml: error: file not found.
Command: C:\Windows\System32\config\systemprofile.gradle\caches\transforms-1\files-1.1\aapt2-3.2.1-4818971-windows.jar\0b5860598e9c67615c35754aea535df6\aapt2-3.2.1-4818971-windows\aapt2.exe compile --legacy \ -o \ C:\Users\ArPa\Documents\app\build\intermediates\res\merged\debug \ C:\Windows\System32\config\systemprofile.gradle\caches\transforms-1\files-1.1\appcompat-v7-28.0.0.aar\469a8bd93b2c9fb2a42463f1ac0d81a5\res\layout\abc_action_bar_up_container.xml Daemon: AAPT2 aapt2-3.2.1-4818971-windows Daemon #2

My build.gradle

buildscript {
    repositories {
        maven {
            url 'https://maven.google.com'
        }
        jcenter()
        google()
        maven { url 'https://maven.fabric.io/public' }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.1'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}
allprojects {
    repositories {
        jcenter()
        maven {
            url 'https://maven.google.com'
        }
    }
}
task clean(type: Delete) {
    delete rootProject.buildDir
}

My gradle-wrapper.properties

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.8-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

What can I do? Thank you in advance!

1

1 Answers

0
votes

AAPT2 had one last bug with long windows paths - it was fixed recently and should be available in android gradle plugin 3.4 beta 1 or 3.5 alpha 2. Upgrading to these versions once they're out should get rid of this error. Until they're out (should be soon), there are two things you can do:

  • move the gradle cache closer to C: to shorten the path
  • if that doesn't work and your AS installation is on a different drive than your gradle cache and your project, try moving them all to the same drive