Endeavoring to rebuild project files...having problems


I’ve had spectacular success working through the example code in Ch 1- 4 as well as made significant progress with the challenges at the ends of the chapters. However, I was having problems with the code that I’d generated as I worked through Ch 5, so much so that at the end I decided to delete my project and import the project files for chapter 5 from the website. I think the import went fine. This was done via,
File->Import->General->Existing Projects into Workspace, Next
Select root directory: /path/to/project
Projects->Select geoquiz
Check “Copy project into workspace” and uncheck "Add project to working sets"
The problem now when I try to run is I get an error message saying, “Your project contains error(s) please fix them before running your application.” Checking the source files I find lots of “R cannot be resolved to a variable” error messages. Any suggestions?
I’ve checked around online as well as Googled, but found no specific “Ah-ha” items that have brought about resolution.

Thanks for putting together such a great book and easy to follow tutorial.


Did you check if R.java file is in your gen folder ?


Yep, first thing I did.


There are two different imports.

One is Import -> General -> Existing Projects into Workspace
One is Import -> Android -> Existing Android Code Into Workspace

You might want to try the other way and see if it solves your problem.