This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
I am trying to learn android. I configured eclipse for android, but I get some problems, which I could not figure out why. When I create a new project, I give all the details like project name, package name, etc.. and when I click finish, it gives me 2 errors:
1. Project "HelloAndroid" is missing required source folder: 'gen'
2. The project could not be built until buid path errors are resolved.
Could some one please help me solve the problem.
thanks,
Divyaa
James Dixon
Ranch Hand
Joined: Jun 20, 2009
Posts: 32
posted
0
Hi Divya
I've had the same problem as well. I think the issue is that the project creation does not initiate a build when it finishes, so you need to make a change, and save for it to generate the gen folder.
For me creating a new java class seemed to do the trick, but I'd imagine just making a change to a file and saving should work too.
Robert F. Howard
Greenhorn
Joined: Nov 05, 2009
Posts: 1
posted
0
I just ran into this, too. I am following the example in Hello Android, which I assume is what the others in this thread were doing. James's solution (editing the source file) worked for me, so thank you for that.
So your solution is good, but I don't think I totally believe the diagnosis. The thing is, the directory actually did exist before I edited the file and rebuilt. This is my first time using Eclipse, and it's very disappointing. The error message should specify the full path of the directory it wants, and then it should be possible to create the directory and re-build, but it doesn't work until the source file is edited. It makes me wonder what is really going on inside Eclipse.
This seems to be a small glitch courtesy of Eclipse's distancing itself from the OS filesystem (which is why Eclipse has an explicit Refresh command).
The gen folder and the "R.java" file are built by one of the Android utilities. The Eclipse Android plugin invokes this app, but it doesn't always know when it needs to. I have similar problems when I want to define a new resource ID. Since I can't seem to get the GUI resource ID definer to enable itself, I just create new IDs in the resource files themselves. But unless I trigger the android resource generator, they don't get inserted into "R.java".
And you don't want to manually insert into "R.java", because when the resource compiler does fire off, your code mods will be overwritten.
One way to force the issue is to select the Project/Clean menu command. If you have the automatic build switched off, you'll then have to initiate a build. Otherwise the clean will fire off the auto-build process.
Customer surveys are for companies who didn't pay proper attention to begin with.
Minh Hoang
Greenhorn
Joined: Dec 17, 2009
Posts: 2
posted
0
divya anand wrote:Hello All,
I am trying to learn android. I configured eclipse for android, but I get some problems, which I could not figure out why. When I create a new project, I give all the details like project name, package name, etc.. and when I click finish, it gives me 2 errors:
1. Project "HelloAndroid" is missing required source folder: 'gen'
2. The project could not be built until buid path errors are resolved.