To avoid this annoying problem, I have 3 solutions that worked for me.
Solution 1)
delete the created R.java file inside your gen / folder
Solution 2)
a) Delete your project from Eclipse ( I said ONLY from Eclipse , uncheck: Delete project contents on disk)
b) import the project into Eclipse: file> Import> Existing projects in the Workspace (Look for your project previously deleted from Eclipse)> Finish.
Solution 3)
1, 2