Android accessing wrong resource … How do I solve this?-Collection of common programming errors
Apparently the eclipse debugger is not as dependable as I expected.
While I was working with the debugger, I noticed that resource ID is correctly being found, but when I really nitpick into the debugger, the inputStream seemed to be getting built from another source.
I thought that was the reason my code was crashing, but it wasn’t.
I use a SIMPLE xml android library – if the xml you pass it is in an unexpected/invalid format, it can’t build the data models you create (My XML was invalid – therefore the crash).
I did a roll back to notice that new XML I had added, crashed the run.
The debugger just cranked out… giving me nulls when things weren’t null, showing different values even when my logs were printing correct values!
Once I saw this hapenning, I didn’t trust the debugger as much as I ususally do.
My advice : If the simpler solutions on this page have not worked for you – Take the following steps:
-
Suspect code additions first! If something you added suddenly breaks your working code, it’s probably your own error.
-
If your debugger acts weird, print useful log information (It is much faster) to give you the right information in the right places.
These are the exact steps I took to find the root of the problem.