I created a new xml file, and had an errant ? in it that prevented R.java from regenerating. I tried Cleaning the Project, and Fixing the Project Properties but no luck.

Then I realized the XML was creating the R.java from recreating itself, so I deleted the XML file and the R.java was back.

Now though, I am getting an error on all the calls to R.*.* calls saying that :

* cannot be resolved or is not a field

So, for instance I have 

```
setContentView(R.layout.detectlayout);

```

ERROR: detectlayout cannot be resolved or is not a field

for all of my calls to 'R.'. Any ideas?

I have tried all of the suggestions on SO already to no luck =/
['https://Stackoverflow.com/questions/4211509', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/496686/']
Look at the 'import' section of your code. Since you deleted your original R, chances is Eclipse help you to fill in the R as com.android.R instead of com.yourproject.R

I also sometimes have problem in Eclipse Resource stuff, sometimes I found turning off and on the "auto buiild" function may help, or simply restarting Eclipse may sometimes help. It's kind of buggy under Mac OS.
first don't bother deleting the R file it not going to make things better only worst lol 

as you said you some times need to clean the project
when you start modifying resources its good to select the root of your project and do a alt+shift+o to reload all ressources
then f5 to refresh the tree 
then clean the project

you also have to check that eclipse is set to build automatically (Project->build automatically).