Libpng error at :app:mergeDebugResources - Gradle Error 42

南楼画角 提交于 2019-12-07 05:56:37

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/28564094/libpng-error-at-appmergedebugresources-gradle-error-42

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!