Error: crash in some files, see Logs for a more detailed gradle update

Afer update gradle version to classpath 'com.android.tools.build:gradle:2.3.0' I got this error.

 Error:Some file crunching failed, see logs for details Error:Execution failed for task ':app:mergeDebugResources'. > Error: Some file crunching failed, see logs for details AAPT err(Facade for 596378712): \\?\C:\Users\\.android\build-cache\2fe51ff37440fab8f5f875609a799aebf31c9e02\output\res\drawable-xxxhdpi-v4\abc_ic_menu_share_mtrl_alpha.png ERROR: Unable to open PNG file AAPT err(Facade for 596378712): \\?\C:\Users\\.android\build-cache\2fe51ff37440fab8f5f875609a799aebf31c9e02\output\res\drawable-xxxhdpi-v4\abc_tab_indicator_mtrl_alpha.9.png ERROR: Unable to open PNG file AAPT err(Facade for 596378712): \\?\C:\Users\\.android\build-cache\2fe51ff37440fab8f5f875609a799aebf31c9e02\output\res\drawable-hdpi-v4\abc_btn_radio_to_on_mtrl_015.png ERROR: Unable to open PNG file 

I do not use 9.png files. How can I fix it?

+5
source share
8 answers

I have exactly the same problem in Android Studio 2.3 . I spent 2 days solving this problem.

Your problem

 AAPT err(Facade for 596378712): \\?\C:\Users\\.android\build- ..... 

The folder name of your account(reverse R?) Is not the name of the ascii folder, so build-cache cannot recognize your folder.

Solve:

For Ex:

 in gradle.properties android.buildCacheDir=D:/android-studio/build-cache 

You can easily create your own application. Thanks.

+8
source

I also upgraded to Studio 2.3, and this error suddenly occurred.

 AAPT: \\?\C:\Users\LeoΕ‘\.android\build-cache\ce4c6faf7b6acf7c9a9f7875a69dc5776c2cfd5b\output\res\drawable-xhdpi-v4\msbp_math_compass.png ERROR: Unable to open PNG file 

I realized one similarity in your and my logs: non-ASCII characters in the username. Then I found that it is a build cache directory. And there was information on how to turn it on. So I tried to disable it:

gradle.properties

 android.enableBuildCache=false 

And it works! I can compile my project again. I sent question 236304 to Google.

Another option is to change the location of the build cache:

 android.enableBuildCache=true android.buildCacheDir c:\\Dev\\Android\\cache\\ 
+6
source

I started getting this error also with Android Studio 2.3 on Mac. Neither disabling buildCache nor changing the location of buildCache resolved the issue.

Renaming all my 9-patch drawings from 'xyz.9.png' to 'xyz.png' - deleting '.9' in the file name - fixed the problem .

+2
source

Check your png files, in my case it was a problem (one image was a jpeg file with .png at is end) Delete it / them and replace it / them with "real" png files and it may work

+2
source

The file path may be too long for the compiler to build it. Try moving the project to another location to reduce the length of the destination.

+1
source

I came across the same situation as @wooldridgetm.

Later, I discovered that if my file with 9 patches has a marked stretch area for both the left and the upper side, not only for one side, then the problem is solved.

I do not know if it is allowed to have only one side before. I hope for this help.

+1
source

The problem is with 1 damaged image file in drawable . I changed it and the problem was resolved very quickly. The answer is very simple, but the error message is rather ambiguous. I changed gradle and android studio, but the solution was very simple than I thought.

0
source

In my case, it was a damaged PNG file in resources. Try looking at all your images and see if you can view them in any external preview program.

0
source

Source: https://habr.com/ru/post/1264985/


All Articles