Android resource not found exception?

I am having a strange problem using findViewById(id). It comes back with resource not found even though the resource is definitely there. It is a textview in a layout next to another textview, one of the textviews I can find by id but the other shows resource not found. Is there any reason this might be happening?


Solution 1:

Make sure that you aren't really just trying to set the text to a number and expecting it to automatically convert to a string.

Solution 2:

Try cleaning your project or post some code.

Sometimes the ID's do not get correctly regenerated if you are using Eclipse. This requires the project to be cleaned and sometimes refreshed.