1

Recently i updated the eclipse software and when i started doing new projectsenter image description here, the R.java file was missing. I copy pasted it from the previous projects but the current project is still giving errors. The errors I am getting are shown in the image. Please help.

This is my SDK manager

enter image description here

3
  • 4
    Have even done a search for this problem? A quick google reveals many answers. Perhaps this will help you stackoverflow.com/questions/3232274/… Commented Oct 4, 2013 at 10:31
  • I think there some problem on your resource that y R file not generated again. Commented Oct 4, 2013 at 10:31
  • 1
    sometimes if you do alot of copy pasting eclipse will put import android.R; in your imports and you get that error, see if its in your imports take it out and clean and rebuild Commented Oct 4, 2013 at 10:42

5 Answers 5

1

Project -> Clean.

This will generate R.java automatically

If it doesn't work, please detach all resource xml file from your project and do above.

And attach xml files again and do above again.

Sign up to request clarification or add additional context in comments.

15 Comments

Don't edit R.java by yourself. If you edit it manually it will be broken.
when i am cleaning the project and building it again, it is giving me an error. it is saying that building workspace has encountered a problem, errors occurred during the build, the error is null pointer exception.
What is your eclipse version and ADT?
Open activity_phonegap.xml with Android XML Editor (Not general xml editor). If there is a bug in your layout file, editor shows you error point.
ADT version 21.0.1 Eclipse version 4.2
|
0

The R.java file is autogenerated, follow these steps:

  • Make sure "Build automatically" is checked in the project menu
  • Go to project->clean...->clean your project
  • Make sure there is no errors in your xml files and clean again

If it still doesn't work, show me your imports

Comments

0

The fact is that probably you're missing the Android Build tools. Or you just need to update them.

If you already updated the SDK tools, re-open the SDK manager and check under the "Tools" section that "Android SDK Build tools" are installed and eventually, update them. That made the trick for me yesterday.

Comments

0

Follow the steps:

1) Make a clean of your project. 2) Close your project and open your project. 3) Close eclipse and restart. 4) Even if its not working then create a new project and place all Source and resource files from Earlier to this one.

This problem generally occurs when you update SDK manager but it's not permanent.

3 Comments

yep i did all these things. but still the project is not working fine. can u plz tell me how can i do to my previous version of the software?
Are you using Windows System or Mac System or any else?
Do you have jar files in your project. If yes then go to the properties->java build path-> Order an Export-> Check android private library.
0

It should be a problem with at least one of your resources files. Please do

Project -> Clean

Meanwhile look at the console window. It may indicating the problem's path.

enter image description here

If you are using a higher version of the android sdk. Just check whether have you installed the 'SDK build tools'.

enter image description here

and also check whether did you update necessary sdk packages and specially the android tools to the newest version.

enter image description here
(source: opencv.org)

8 Comments

the problem is when i cleaned the projects the files which were present in the gen folder got disappeared :( dont know what has happened.
When you clean the project, it will remove the R file from the gen folder and re checking the resources and re generate the R file. If a problem having with a resource file, the R file will not be generated. That's why R file is disappeared.
i regenerated the R file but the gen folder is showing empty
Actually I am not getting any messages as such in the Console. All the projects i have done are full of RED crosses.
First, Identify the error and fix it. Then the R file will be in the gen folder.
|

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.