While working with an android project .I'm stuck with R.java file which is not found even I clean the project(project---->clean).But that file still not found .Even I create a new project the same problem occurs . what I need to do ? I'm expecting the valuable replies from which I could overcome this problem
-
delete gen folder and build your project works?? – Shiv Mar 04 '13 at 13:03
-
i am not sure but try it if it works ... right click on your project go to Android Tools and click on Fix Project Properties..and then delete gen folder and build it again?? – Shiv Mar 04 '13 at 13:16
-
Remove, if any import android.R; – Shiv Mar 04 '13 at 13:19
-
I already done the steps you told, but no change – Rakesh L Mar 04 '13 at 13:42
5 Answers
R.java is missing implicate that your resource folder is having some issues. please try to look at your resource files(layout,drawable etc). and after that clean the project. it will solve the problem for sure.

- 9,274
- 5
- 30
- 47
-
There is no problem in resource files .Even if i create a new project the same problem occurs – Rakesh L Mar 04 '13 at 12:29
-
Then android target is not set. project->right click->Properties->android and set the android target – Dinesh Prajapati Mar 04 '13 at 12:33
-
If the android Target is not set .The library classes like Activity ,won't import.Anyhow,I've set my project to API 17 – Rakesh L Mar 04 '13 at 12:35
Have you checked that your builders are set up correct? To have the R.java file generated there's a need that the Android Pre-Compiler has processed all the resources.
In Eclipse go to "Project --> Properties" and select "Builders" from the list.
Only if these builders are set, the R file can be generated.

- 1,927
- 18
- 34
-
Your answer in my case is not effective on my project. Once I created a project, I noticed that there is no R file in the gen folder. What should I do? – David Dimalanta Jul 17 '13 at 04:02
-
@DavidDimalanta Have you already created a build? "Project => Build all" (maybe you have to uncheck "Build automatically") - are there any errors you get? If you don't succeed, please ask a new question. – Briareos386 Jul 17 '13 at 07:53
-
I have selected all the builders and clicked ok. I cleaned and build project again but still R.java is not generated. – Malwinder Singh Nov 15 '14 at 12:07
-
Hi @M.S. - would you mind opening a new question if all these answers didn't help you out? – Briareos386 Nov 24 '14 at 09:55
R.java missed only when there is some problem in resource files. Check properly your Menu files , layouts, and Drwables, (sometime same image names with .jpg and .png extensions are existeing).
Or you can create new project and paste everything in new project then check it again.

- 1,397
- 1
- 9
- 15
-
There is no problem in resource files .Even if i create a new project the same problem occurs – Rakesh L Mar 04 '13 at 12:31
-
I can't see my logcat as I can't even run my project with this error .if I run my project a dialog shows that my project contains error(s),please fix them before running my application – Rakesh L Mar 04 '13 at 12:38
-
if you are using any menu xml please remove it for a while and test your project without using menu xml. then clean your project and test it. because some time there is some problem in menu file and eclipse dont indicate with red cross. – Mudassar Shaheen Mar 04 '13 at 12:45
- click Project --> Build Automatically
- check build automatically
- clean the project

- 302,674
- 57
- 556
- 614

- 6,527
- 8
- 50
- 85
-
1
-
I have face this problem many time but everytime due to this problem only ,you can try restarting eclipse , mean while i ll try what else can i find for you – Hussain Akhtar Wahid 'Ghouri' Mar 04 '13 at 12:36
simple way! go to import section (top of current java class) and remove wrong import R, then go over the R and click Alt+Enter, then android studio import true R.

- 3,099
- 2
- 19
- 15