I am testing 9-patch image .
Before everything works fine , and i rename drawable
file ic_button_beat_box_default.png
to ic_button_beat_box_default.9.png
, then i get error :
Some file crunching failed, see logs for details
. Then i rename back , it works normal. So how this happens ?
The complete error is :
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:mergeDebugResources'.
> Some file crunching failed, see logs for details
* Try:
Run with --info or --debug option to get more log output.
* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:mergeDebugResources'.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)
...
Caused by: java.lang.RuntimeException: Some file crunching failed, see logs for details
at com.android.builder.png.QueuedCruncher.waitForAll(QueuedCruncher.java:260)
at com.android.builder.png.QueuedCruncher.end(QueuedCruncher.java:280)
at com.android.ide.common.res2.MergedResourceWriter.end(MergedResourceWriter.java:132)
at com.android.ide.common.res2.DataMerger.mergeData(DataMerger.java:291)
at com.android.ide.common.res2.ResourceMerger.mergeData(ResourceMerger.java:48)
at com.android.build.gradle.tasks.MergeResources.doIncrementalTaskAction(MergeResources.java:250)
at com.android.build.gradle.internal.tasks.IncrementalTask.taskAction(IncrementalTask.java:124)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:75)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$IncrementalTaskAction.doExecute(AnnotationProcessingTaskFactory.java:244)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:220)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$IncrementalTaskAction.execute(AnnotationProcessingTaskFactory.java:231)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:209)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
... 57 more
On Windows I had a "BUILD FAILED Failed to crunch file [path]" error and solved it by closing the Android Studio project, copying the entire project folder into a location with a shorter directory path, such as my C: folder and then opening the project in the new location. Hope it helps
Rename your file again
ic_button_beat_box_default.9.png
to ic_button_beat_box_default9.png
because android studio takes ic_button_beat_box_default.9
instead of ic_button_beat_box_default.9.png
or another solution is add below line to your build.gradle(Module:app)
android{
aaptOptions {cruncherEnabled = false}
}
I had the same issue by changing only file name, when I saved the image in 9-patch-tool issue solved.
I had the same issue. I was able to resolve it just by reducing one folder from chain. It is due to long file path. So try using minimum hierarchy for your project location.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With