Reputation: 4533
I am working on an app which was working fine .
I tried some new layout files but when I build the project the R.java file is not generated . I tried clean and build project but still the file is not generated.
Why is this happening?
What should I do now to regenrate the files?
Upvotes: 2
Views: 4803
Reputation: 2979
So I realize this question has already been answered. However, I had the exact same problem today and was stuck on it for about an hour. I have come up with a different solution that solved my problem. The XML did not have any errors/typos in them. I was trying to get the Google Wallet example to run.
My solution ended up being that the android:minSdkVersion (in the manifest file) was set too low. I simply raised this value and all errors were gone.
Upvotes: 0
Reputation: 37969
Check if you have main.xml file in the menu folder, but don't have in strings.xml
<string name="action_settings">Settings</string>
Sometimes that is the reason in my case.
Upvotes: 0
Reputation: 197
I tried the following. Consider the application name to be "My First Application". Then the name of the package should be com.xx.myfirstapplication.yy. Make sure that you add a yy after the application name in the package field while creating the application. Hope it helps.
Upvotes: 0
Reputation: 2343
In my experiences, Eclipse ADT will not show every errors in package window, e.g. Asia characters file names, and system-config-file from Windows. Sometimes, you have to re-import your project after check and remove these files.
Upvotes: 0
Reputation: 3204
R.java file is automatically generated in application. If you want to know why your R.java file is not generated then there are some problem into your last layout file made by you.
If there is illegal according to android OR if there is any error in XML file then R.java file will be deleted.
Thanks.
Upvotes: 2
Reputation: 39992
Android will not generate the R.java after a clean if any of the XML files have errors in them. Check for any errors and fix them. R.java will then be built.
If that doesn't work, sometimes Eclipse looses track of the file. Click your project and hit F5 to Refresh the project.
Upvotes: 12
Reputation: 5410
Try refreshing your project. Right click on your project folder in the project explorer, and click on the Refresh option
Upvotes: 1