开发者

Error reading PNG metadata Android UI designer within Eclipse

开发者 https://www.devze.com 2023-03-24 00:11 出处:网络
I\'m using the Android plug-in in my Eclipse environment to design layouts. I have a variety of PNG files in different locations. Some of these PNG files cannot be rendered by the plug-in although th

I'm using the Android plug-in in my Eclipse environment to design layouts.

I have a variety of PNG files in different locations. Some of these PNG files cannot be rendered by the plug-in although they can be opened in image editors and appear perfectly in the application itself.

The error displayed on the plug开发者_运维知识库-in depends on the Android version chosen. For >= 3.0, I see:

Failed lot load MyProjDir\res\drawable\roll.png

for Android <3.0, I see:

Unable to resolve drawable >"MyProjDir\res\drawable\roll.png" in attribute "src"

Either way, the error log shows:

javax.imageio.IIOException: Error reading PNG metadata at com.sun.imageio.plugins.png.PNGImageReader.readMetadata(Unknown Source) at com.sun.imageio.plugins.png.PNGImageReader.readImage(Unknown Source) at com.sun.imageio.plugins.png.PNGImageReader.read(Unknown Source) at javax.imageio.ImageIO.read(Unknown Source) ... many more entries ...

It would appear that the PNG's with the problem have some metadata (or lack some metadata), causing the issue.

One possibility, is to save the PNG's using some other editor. I'm using GIMP, and I've tried Windows 7's Paint to no avail.

Any suggestions?


Try switching to a different Java SDK. I get that same "Error reading PNG metadata" error when using Sun Java 5 though the same exact thing works with OpenJDK or Sun Java 6.

0

精彩评论

暂无评论...
验证码 换一张
取 消