:app:mergeDebugResources 处的 Libpng 错误 - Gradle 错误 42 [英] Libpng error at :app:mergeDebugResources - Gradle Error 42

查看:23
本文介绍了:app:mergeDebugResources 处的 Libpng 错误 - Gradle 错误 42的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 Android Studio 中编译我的应用程序进行调试时,出现以下错误:

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

我已经检查过我的所有文件都是 .png 格式,但我不确定哪里出了问题.

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

推荐答案

解决方案

我尝试在 Adob​​e Fireworks 中打开我的文件 (img_myImage.png),但它无法打开文件,所以我在 Photoshop 中打开了它,确实然后我将其重新保存为 .png 文件,这似乎解决了问题.

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.

这篇关于:app:mergeDebugResources 处的 Libpng 错误 - Gradle 错误 42的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆