wood burning stoves 2.0*
The moose likes Android and the fly likes android in eclipse Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Mobile » Android
Bookmark "android in eclipse" Watch "android in eclipse" New topic
Author

android in eclipse

divya anand
Greenhorn

Joined: Oct 28, 2008
Posts: 25
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.


Could some one please help me solve the problem.

thanks,
Divyaa



James Dixon
Ranch Hand

Joined: Jun 20, 2009
Posts: 32
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
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.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16095
    
  21

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
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.


Could some one please help me solve the problem.

thanks,
Divyaa





I dun really know the reason, but you just delete the "gen" folder in your Package Explorer (Eclipse IDE) and rebuild your project.
http://trinhquochungnotes.blogspot.com/2009/12/android-error-on-missing-resource.html
Gook luck,
 
GeeCON Prague 2014
 
subject: android in eclipse