Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Libpng error at :app:mergeDebugResources - Gradle Error 42

When compiling my app for debug in Android Studio, I get the following error(s):

Failed to run command:
C:\Users\Farbod\Android-SDK\build-tools\21.1.2\aapt.exe s -i C:\Users\Farbod\AndroidStudioProjects\MyApp\app\src\main\res\drawable-hdpi\img_myImage.png -o C:\Users\Me\AndroidStudioProjects\MyApp\app\build\intermediates\res\debug\drawable-hdpi-v4\img_myImage.png
Error Code:
42
Output:
C:\Users\Me\AndroidStudioProjects\MyApp\app\src\main\res\drawable-hdpi\img_myImage.png: libpng warning: IDAT: Too many IDATs found
libpng error: Read Error
:app:mergeDebugResrouces FAILED

I've checked that all my files are in a .png format, and I'm not sure what could be wrong.

like image 646
Farbod Salamat-Zadeh Avatar asked Sep 28 '22 18:09

Farbod Salamat-Zadeh


1 Answers

SOLUTION

I tried opening my file (img_myImage.png) in Adobe Fireworks, which wouldn't open the file, so I opened it in Photoshop which did work, and then I re-saved it as a .png file, which seemed to solve the issue.

like image 195
Farbod Salamat-Zadeh Avatar answered Oct 03 '22 08:10

Farbod Salamat-Zadeh