My project was running properly.I just gave a Lint check and it gave me errors from all projects. So I just cleaned my project. But now its not generating R.java file. How can I recover it. I tried building..But its not working
Asked
Active
Viewed 723 times
-1
-
try to clean project again.. – Pragnesh Ghoda シ Jun 16 '14 at 05:15
-
check you problem window is show where exactly error. – Haresh Chhelana Jun 16 '14 at 05:20
-
Try to restart your eclipse. – Born To Win Jun 16 '14 at 05:23
-
i cleared errors given in the problems window.Now it has only this error:R cannot be resolved – user3698989 Jun 16 '14 at 05:26
3 Answers
0
Try to check you resource folder(res/
), it is containing error, Fix all error in res/
folder. then clean up your workspace. and build the project again, it will works.
R.java
is automatically regenerated for you as soon as your res/
is corrected.

Lavekush Agrawal
- 6,040
- 7
- 52
- 85
-
I didn't had any errors...i just gave Lint check and it gave me errors..So i cleaned it..it ws giving missing translations in the strings.xml file..How to add that? – user3698989 Jun 16 '14 at 05:19
-
I have used only values folder..I didn't make use of other language folder..Then why its giving errors? – user3698989 Jun 16 '14 at 05:58
-
0
My answer is assuming that you are using Eclipse. Cleaning a project deletes its bin and gen folders and rebuild them again. Don't clean while having errors in the project as it won't build R.java on cleaning. It will show a lot of R errors in project as R.java is no longer present. But it will be showing the actual error in the console window. Fix it and R will build automatically.

berserk
- 2,690
- 3
- 32
- 63
-
I didn't had any errors...i just gave Lint check and it gave me errors..So i cleaned it..it ws giving missing translations in the strings.xml file..How to add that? – user3698989 Jun 16 '14 at 05:18
-
-
@user3698989 I don't know what errors you are getting. But if they came from the lint check, try removing it and build. – berserk Jun 16 '14 at 05:21
-
@user3698989 I don;t know about missing translaion errors, but heres a link. Maybe it can help you http://stackoverflow.com/questions/14232728/android-lint-limit-languages-to-check-for-missing-translations – berserk Jun 16 '14 at 05:33
0
First you check Your *.XML files if there is any error If error then first solve it.
- Remove all import android.R from your activity
- Run Project->Clean it remove all auto generated files
- Build project using Project - Build Project it rebuild your project OR Checked Auto Build ON
- Wait for a while it regenerate all files including R.java
- If steel R.java is not generate then it is problems related to Project Build Target
- Right click Project Go Properties->Android see in right section Project Build Target and see it match with your AndroidManifest.XML
- Make change accordingly and repeat above steps
This one help you..

Bhadresh
- 115
- 2
- 3
- 13