Hi! Recently I started to learn Android development, and while making a project from a book,I got into a problem in running the project code. I had to do a photo gallery. All went well, but when I try to run it, I get an error in R.java class automatically generated by Eclipse. After class R has been generated I found that at the end of the class a brace is missing. I tried to edit the code but Eclipse won't let me. I created another project and I got the source code from the book and the same error appeared in class R (the last brace was not generated). How can I solve this problem?
2 Answers
Try this:
1.- Import the project into eclipse (File -> Import -> General -> Existing Projects into Workspace)
2.- In Eclipse, Manually create gen folder and add it as source folder (right click on the project: Build Path -> Configure Build Path -> Add folder)
3.- Clean the project, you suppose to get R.java well generated
Comments
Try these.....
- Delete the R.java file, then clean the project.
- See, is there any error in your .xml file, which are used to define your layouts.
- Don't do any manual changes to the R.java file, its an auto-generated file which contains the constants, grouped according to their xml resource type.
R.javain your filesystem and run the application.Ris a very common issue. You should never edit it though. Search around for possible solutions. The first thing I'd try is to clean the project.