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 :)
来源:https://stackoverflow.com/questions/34218249/android-studio-aapt-err-libpng-error-not-a-png-file