I cleaned my whole project and now Eclipse gives me errors... R cant be resolved. If I import R it gives me more errors and errors. Any ideas how to solve this?
-
check this http://stackoverflow.com/questions/885009/r-cannot-be-resolved-android-error and http://stackoverflow.com/a/7824975/1329126 – Sankar V Apr 22 '13 at 14:48
-
you probably have an error in one of your xml files and therefor R is not being generated. check them and the project properties and delete R – thepoosh Apr 22 '13 at 14:48
3 Answers
Usually this happens if theres an error somewhere in your resource files and the R.java file cannot be generated properly. Check for any error messages on the console about problems in your files.

- 10,064
- 2
- 40
- 42
-
Hm I didnt had any errors in my files before I cleaned my project – LSProductions Apr 22 '13 at 14:48
-
I've discovered that this error may happen due to the R.java file not being regenerated properly. And the reason for it to not be generated properly, you may have an error in your XML files that is not detected/higlighted by Eclipse. Make sure you check them one by one.

- 8,437
- 14
- 64
- 118
Make sure your resource files do not contain any errors, also make sure there are no "unsaved changes" pending in your opened resource files (mostly happens in XML files).
after that if R still can't be resolved you can invoke eclipse to generate it manually by pressing Project > Clean
.

- 6,383
- 7
- 46
- 68