3

I have an App that was working perfectly, then I released an update and now suddenly some users cannot inflate the main view.. it is dying on inflation of the XML on line 28 with a nested exception of

Resources$NotFoundException: File From Drawable resource ID #0X10200004

on line 28 of the Binary XML inflate which references @drawable/pl

the pl.bmp file is in the res/drawable directory and is not corrupted, so the resource exists.

The only thing I can see that seems odd is the R.java file that is generated references this drawable with an id of #0X7F0200009, and there are no files reference id's that start with #0X1.... at all.. so I am not sure how or why these particular users are even getting that ID as the reference for the drawable. There is an #0X7f0200004 in the R.Java drawable class but it is a completely different graphic.

This is certainly happening with some folks who have upgraded, and I suspect with some folks who have purchased new. I am unable to replicate this behvior on any device I have access to, or on the emulator, but it is clearly happening for some people.

Does anyone have any ideas? Is the upgrade not picking up the right R.java file? How is that even possible? At first I thought it might be a file name collision as earlier releases had p as a bmp and release where this started I changed it to a png, but I made sure to delete pl.bmp before build, and subsequently renamed it to pl, so there is no way even if the old p files both .bmp and .png were somehow on the device it would not possibly collide, but this doesn't seem to be the problem.

Any help would be greately appreciated.

Thanks in advance.

Speckpgh
  • 3,332
  • 1
  • 28
  • 46
  • How large is the image (both in pixel-size and file-size)? If it is a very large image that exceeds the bitmap memory available to the device (this differs for different devices) then you will get errors like this, essentially the resource itself is found but cannot be loaded into the program, and then the program complains it can't find the resource. – Joseph Earl Sep 24 '11 at 18:54
  • The image is very small.. Like 20x20 and under 1k in size So it's not the size limit. – Speckpgh Sep 24 '11 at 23:26
  • I did put the element that is holding this image inside a horizontal scrollview as well, which when the problems started but I don't know why that would effect the inflation. It's not every user but it's definitel a reasonable number and this is infuriating. – Speckpgh Sep 24 '11 at 23:28
  • Well I did some futher investigation, and now I am more confused than EVER. Turns out the line it was dying on with the notfoundexception is the following: "setButtonDrawable(android.R.id.empty);" Which makes no sense to me... how can it not find the drawable tied to an ID that is part of the OS, suddenly for users who had everything working perfectly?? So it turns out it had nothing to do with my images at all, but this line.. so I am left with assuming that somehow nesting this element in a horizontalscrollview somehow tickled a bug in the OS of certain hardware devices. Ugh! – Speckpgh Sep 26 '11 at 13:22
  • I have changed the above to use an transparent drawable, that I supplied instead of the id.clear that is part of the OS, and so far I haven't had any further reports of bugs... but yesterday was a Sunday so I don't know how many people upgraded etc. Since I can't replicate the issue on any device or emulator I have I can't say the issue is resolved, if this doesn't work, I don't know what to do why would moving an element into a subview in the XML suddenly have the inflator not find an object/drawable that is part of the OS and that it was finding perfectly fine before? – Speckpgh Sep 26 '11 at 13:27

1 Answers1

1

Well this amazingly appears to be something related to an OS Drawable reference tied to the android.R.id.empty.

Don't ask me why this worked fine, and then suddenly started not working for some users after I change my XML definition, but I have removed the reference to this and am now using my own transparent graphic instead and everything appears to be working fine.

Speckpgh
  • 3,332
  • 1
  • 28
  • 46