1

I have a problem with 9 patch images.

There are around 30 9 patch images in my res folder. On earlier versions of Android Studio, errors told me exactly which one of the images was bad, but on newer versions I just get error

Error:Execution failed for task
 ':app:mergePhotoKeyboardThemeChangerDebugResources'.
 
Error: java.lang.RuntimeException: Some file crunching failed, see logs for details

Is there an option for that in Android Studio settings? It is a lot of work to check images one by one and see which one is bad.

Ramesh R
  • 7,009
  • 4
  • 25
  • 38
filipst
  • 1,547
  • 1
  • 30
  • 55

2 Answers2

1

Some times the error will come with jpg images, try to convert the jpg images to png images. convert online from online png converter.

Ramesh R
  • 7,009
  • 4
  • 25
  • 38
0

Suggestion#1:

Relocate your project and the build will succeed.

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

Suggestion#2:

Sometimes .png images are corrupted. you need to replace in drawable

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

Suggestion#3: change build directory

For example:

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

Rebuild and happy coding.

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

Last Suggestion Add

aaptOptions {
    cruncherEnabled = false
}

in your gradle(app) file in android{ } scope

it will work fine

Vinesh Chauhan
  • 1,288
  • 11
  • 27