Error:Execution failed for task ':app:mergeDebugResources'. > Some file crunching failed, see logs for details build gradle issues

大憨熊 提交于 2019-11-29 09:20:28

In the individual apps's build.gradle, section android {}, insert :

aaptOptions {  
    cruncherEnabled = false  
}  

Reference

All problem was a crashed png image in one of my drawable folders. I mean the images which we sometime face in windows photo viewer, like the one below:

I dropped the image from the folder and all problem got solved.

Try running gradle from command line:

gradle clean build --debug

And post your log afterwards.

Pooja Nair

Just check this link - Android Studio - mergeDebugResources exception and libpng error: Not a PNG file Error Showing In Android Studio

You can try this command as well sudo apt-get install lib32stdc++6 on the console if you are working on a linux machine, then restart android studio and run your project

For me, it was a corrupted PNG file. Go to your res folder and try to open every images.

Neon

Actually, image file something wrong. Go to (drawable) and remove image or replace with new image.This will solve problem.

In addition, you can put method in (build.gradle), but This will not solve the problem but good way to catch up what was wrong.

In build.gradle, section android {}, insert (cruncherEnagle = false)apptOptions.

compress the project file and delete prjct. and extract it and open

In my res folder I created a 9PNG file. After deleting this file everthing is working fine.

  1. Browse Through Your Project Manifest and Resource Files to see if there is an error in the Images you are using. (I was missing the roundLauncherIcon).
  2. Check if all the images that you are using are actually existing.

For me, I was getting this error because the full path to the folder was longer than allowed by Windows. I moved my build to a shallower path and this error went away.

Related question: Android Studio 2.2 Google play services sync Error

On react native

When you're inside your project directory try using :

$ cd android && gradlew clean

$ cd .. && react-native run-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!