Execution Failed for Task: ':App:Mergedebugresources'. Android Studio

Android Studio: “Execution failed for task ':app:mergeDebugResources'” if project is created on drive C:

This is caused by the path length restriction.
I think it's 256 characters maximum.

Relocate your project and the build will succeed.

Android - Error:Execution failed for task ':app:mergeDebugResources'

Try code on your module build.gradle:

android {
// ...
aaptOptions.cruncherEnabled = false
aaptOptions.useNewCruncher = false
// ...
}

It means Android studio DO NOT check PNG strictly.

Execution failed for task ':app:mergeDebugResources' , Unable to locate resourceFile in source-sets

I found by several testing that proguard rule is the issue for this error. Changing the proguard rules for debug solves the issue. Just need to set shrinkResources false in the debug buildTypes.

 buildTypes {
debug {
minifyEnabled true
shrinkResources false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}


Related Topics



Leave a reply



Submit