I got this error all of a sudden, I mark the R class in red in the Java code.
AAPT err(Facade for 557143976): libpng error: Not a PNG file
Error:Execution failed for task ':app:mergeDebugResources'.
Some file crunching failed, see logs for details
I already used Rebuild Project and Clean Project several times...
This detail cannot be resolved with :
Build
>Rebuild Project
.I suggest you update the version of gradle!, in my case I use:
The problem can also be due to some problem in the resources, for example if you changed the extension of image files from .jpg to .png Android Studio detects that it is not really a resource with .png format, for that reason it may show an error.
What you have to do in this case is open the .jpg file with a program to manipulate images and save it in .png format