I downloaded few source codes from Google source codes.
I executed them on Eclipse but R.java
file is not created and therefore I got many errors saying
Cleaning the project, delete the R.java and regenerate it. If you have an error anywhere in your /res file (the resources) , the R will not be generated usually. It could be an error in the name of a picture , or anything ... fix your errors before. good luck ;)
I encountered this issue after adding a jpg file with a numeric file name into my drawable folder. I was getting a compilation error, " expected on line y" when trying to rebuild the project after cleaning it. You may want to check that you do not have a similar issue. Although I encountered this while using Android Studio, I am sure it would affect Eclipse as well.
For future readers, restart adb then clean.
After few hours frustration finally I have decide to remove the red marks from the my file where it was not able to resolve the R.java as it was not actually available in my code. After removing the first red line from my activity file the project builds and generated the R.java automatically.
This is something really freaking thing for me as it goes without any reason and came back with the same thing.
Hope this will help you
Kind Regards, Summved
I have encountered similar problem and i changed the workspace folder and all errors disappeared. It's sort of simple solution but it works.