Bostone
Bostone

Reputation: 37126

Android - PNG file makes bitmap XML unparsable

I have a single PNG file that when referred from the XML bitmap file will generate Failed to parse file error in Eclipse resource editor. When I substitute it with other file everything works. When I run the app - the image will not show up. The XML code is:

<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
    android:src="@drawable/linen_android_tile"
    android:dither="true"
    android:tileMode="repeat">
</bitmap>

And here's the file:

img

Upvotes: 0

Views: 979

Answers (4)

Sheridan Bulger
Sheridan Bulger

Reputation: 1214

Also if you're using an indexed png file, try converting it to RGB.

Upvotes: 1

neeraj t
neeraj t

Reputation: 4764

change your png file, may be some internal problem with your image file . It happen some time with me also but change the file worked fine for me.

Upvotes: 0

Hounshell
Hounshell

Reputation: 5459

Unlikely, but worth checking, the filename isn't linen_android_tile.9.png is it? That indicates a 9-patch png and they are treated differently.

Upvotes: 0

Pointer Null
Pointer Null

Reputation: 40380

No problem for me with your PNG.

Solutions:

  • Update to Eclipse ADT plugin version 15
  • Try to refresh Eclipse res folder
  • Save your PNG in 24-bit instead of 8-bit

Upvotes: 0

Related Questions