Error:Execution failed for task ':app:mergeDebugResources'.
Error: com.android.builder.internal.aapt.AaptException: Failed to crunch file C:\Users\SONY\Desktop\Project tango\zip folder Project Tango\tango-examples-java-master\Solution\app\build\intermediates\exploded-aar\com.android.support\appcompat-v7\23.4.0\res\drawable-xhdpi-v4\abc_textfield_search_default_mtrl_alpha.9.png into C:\Users\SONY\Desktop\Project tango\zip folder Project Tango\tango-examples-java-master\Solution\app\build\intermediates\res\merged\debug\drawable-xhdpi-v4\abc_textfield_search_default_mtrl_alpha.9.png
file crunching fails due to improper image or media files make sure all your image name are in small letters without space or special characters except '_'.
also proper format of image is selected e.g if u rename a jpg image to png without converting it wont work.remove the image which u inserted rebuild your project i hope it works for you
Related
Error:Execution failed for task ':app:mergeDebugResources'.
C:\Users\user\AndroidStudioProjects\BrainTrain\app\src\main\res\mipmap-hdpi\USER-PC.eml: Error: The file name must end with .xml or .png
This error as been occurring ever after closing my Android studio
You put a file, named USER-PC.eml in res/mipmap-hdpi/. That is not a valid filename for that directory (wrong extension, dashes not allowed), and quite possibly it is not a valid file for that directory.
So, remove it from the project for now.
Building the project throws the following
error:
Error:com.android.builder.internal.aapt.AaptException:
Failed to crunch file ....\common_google_signin_btn_text_dark_pressed.9.png into ....\common_google_signin_btn_text_dark_pressed.9.png
Error: File path too long on windows, keep below 240 characters
Just try to use shorter path for your project. In my case i have just moved my project folder to desktop and after opening project from desktop this problem will disappear automatically.
I'm using Gradle 1.5.0 with Android Studio. Project syncs with Gradle without any issues, but when I run the app, I get the follow error message
Error:Execution failed for task ':App:mergeDebugResources'.
/Users/Zee/Repos/App/res/drawable/notification.mp3: Error: The filename must end with .xml or .png
Using an mp3 file, so not sure what to do at this point. Any help is much appreciated.
You can't put mp3 file in drawable. Drawable folder is for images. Put your mp3 file or any other format in raw folder.
Raw folder can be found in res/raw
If it doesn't exist then just create a raw folder in res folder.
Possible cause
Another scenario causing the error might be, that you must have mistakenly pasted your whole drawable-xxxhdpi/xxhdpi/xhdpi/hdpi/mdpi folder in your drawable folder which may have resulted in cascading of drawable folder and thus giving this error.
Solution
Just go to that folder & delete the unwanted/extra folders.Then the issue will get solved.
I
I had .zip file containing grandle files, in `res/drawable" folder. Then I deleted it from the "drawable"
directory. It worked for me...
Error:Execution failed for task ':App:mergeDebugResources'.
/Users/Zee/Repos/App/res/drawable/notification.mp3: Error: The filename must end with .xml or .png
this error occurrs when we attempt to delete all files except .xml and .png from all folders in our package.
e.g. If the assets folder has the files debug.exe and java.exe, and we want to delete them
I have search all the possible available solution but still i am facing same issue with unclear error for me.
Now the complete error is-
AAPT err(Facade for 370671127): libpng error: Not a PNG file
Error:Execution failed for task ':app:mergeDebugResources'.
Some file crunching failed, see logs for details
Now from this line libpng error: Not a PNG file actual i am not getting where is the problem exist either in my any image files or anything else except this.
1- Before posting this issues i have changed my all the images existing in the diff-2 folders in required PNG formates as I see as solution in other post.
Note- Its working fine on eclipse now I am importing this in Android Studio.
Since during project build only single(above) error is shown so I guess there is not should be any other issue. I have spend more time to resolve this issues so all the suggestions are welcomes for me.
The problem is in your png files. Probably you images were optimized by some png optimization tools. Android tools use AAPT tool to optimize images during building your project. The reason for this problem is that AAPT tool doesn't know that you preprocessed the image.
To get around this in your application you need to specify the option in gradle
aaptOptions{
cruncherEnabled = false
}
This is disable AAPT optimization for all of your png files.
Similar question was asked here.
Although there can be various reasons for this error , i.e Can't resolve symbol R
But In particular, If the problem is saying Not a PNG file
My Case
For me ,it was a jpeg file that I had saved with extension .png which was the root cause
Solution
remove that jpeg image from your res/drawable folder
Note
renaming a jpeg to png doesn't mean it is a png in android studio... so get rid of that jpeg image
rebuild..
voila.. it works
hope it helps :)
I am trying to run a Phonegap application but some images in the resources directory are preventing it from starting. when i delete the images files from my project it works just fine.
Execution failed for task ':mergeDebugResources'.
Error: Failed to run command:
/Users/macbookpro/Library/Android/sdk/build-tools/22.0.1/aapt s -i ../platforms/android/res/drawable-land-xhdpi/screen.9.png -o ../platforms/android/build/intermediates/res/debug/drawable-land-xhdpi-v4/screen.9.png
Output: ERROR: 9-patch image ../platforms/android/res/drawable-land-xhdpi/screen.9.png malformed.
No marked region found along edge.
Found along top edge.
First remove all your splash.png files and clean your cordova project by using this command ./platforms/android/cordova/clean
then copy the splash.9.png files in your res folders
then build the project, that worked for me.
You can make .9.png files with the help of this online tool