Reputation: 4191
I recently downloaded the Android Support Package and have been using it trying to get my application, running at SDK 10, to use a GridLayout.
Anyway, I cleaned my project a few times working on this error in my XML files, and then when I went back to my classes in /src, every single reference to R.* was an error.
This has happened to me before, but it usually fixes itself, and it has not yet. Does anyone know what to do?
The R.java file is no longer in my /gen folder.
Upvotes: 5
Views: 2650
Reputation: 10646
This happens when you have an error in the res folder. Fix the error first, then do :
Et voila !
Upvotes: 1
Reputation: 374
Follow following steps :
In Eclipse, => Right Click on Project > Android Tools > Fix Project
By this way, you can fix many common problems which can help generate R.java in gen/R.java file.
Upvotes: 2
Reputation: 2878
You can also try Adnroid Tools>Fix Project
. That may help you to create gen/R.java
file
Upvotes: 2
Reputation: 7890
There can be several reasons why this occurs. The following I have found happen to me and I have included the steps I took to resolve them.
Apologies for the approximate locations for some of the Eclipse functions but I am not currently in front of Eclipse to check.
Upvotes: 1
Reputation: 10540
Sometimes if there is an error in your XML files R.java won't build. Go through your XML files to make sure that everything is in order (typo, forgetting to close a bracket, etc). When you fix that it should build itself again.
Upvotes: 5
Reputation: 2628
It sometimes happens when you import another project First i suggest you to build it, it will create automatically .
If it's not working then try to create new project from existing source and specify the downloaded project . It worked for me
Hope this works for you let me know..
Upvotes: 5