Error:Execution Failed for Task ':Projectname:Mergedebugresources'. > Crunching Cruncher *Some File* Failed, See Logs

Error:Execution failed for task ':ProjectName:mergeDebugResources'. Crunching Cruncher *some file* failed, see logs

As stated here this can happen when using the Gradle Tools v1.1.0. After updating to v1.1.3, this has not happened anymore.

Gradle Build Fails Due to Error:Execution failed for task ':app:mergeDebugResources'. Crunching Cruncher photo.png failed

Thanks for the comments.
I ran the png through a png converter and it ended up working.
Even though the image was actually a png.
It's confusing but it worked.

Error on nine patch image: Some file crunching failed, see logs for details

I have collected some sollutions. Please check one by one. Hope it may help you.

Suggestion#1:

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

Relocate your project and the build will succeed.

Resource Link: https://stackoverflow.com/a/25209204

Suggestion#2:

Sometimes .9.png images are corrupted. So you can replace it in your drawables directory.

Resource Link: https://stackoverflow.com/a/41380118

Suggestion#3:

Best solution is changing the buildDir in build.gradle:

For example:

allprojects {
buildDir = "C:/tmp/${rootProject.name}/${project.name}"
repositories {
jcenter()
}
}

Rebuild and happy coding.

Resource Link: https://stackoverflow.com/a/41877283

Suggestion#4:

You can diagonse by the following command:

./gradlew :app:mergeIntegrationDebugResources --debug > buildLog.txt

Once that finished, Open the buildLog.txt file, and searched for "Error" (no quotes in actual search). Then you will find those files are having problems, and then removed it from the appropriate folder, and then re-run the command above until you didn't get any errors.

Resource Link: https://stackoverflow.com/a/36648743

Suggestion#5:

file >> invalidate caches/restart

Suggestion#6:

  1. Go to your build.gradle file in your project.
  2. Change:
dependencies {
classpath 'com.android.tools.build:gradle:1.1.0'

to:

dependencies {
classpath 'com.android.tools.build:gradle:1.1.3'

same problem is also coming in 'com.android.tools.build:gradle:1.5.0'. On that case downgrade it.


  1. Then Clean --> Rebuild

Resource Link: https://stackoverflow.com/a/31638208

Suggestion#7:

for anyone having the same problem. this solved the issue for me:

"aapt" IOException error=2, No such file or directory" why can't I build my gradle on jenkins?

It's an issue with 64-bit OS, because aapt isn't available you have to install these 2 packages:

sudo apt-get install lib32stdc++6 lib32z1

Resource Link: https://github.com/facebook/react-native/issues/7320



Related Topics



Leave a reply



Submit