File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

android in eclipse

 
divya anand
Greenhorn
Posts: 25
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 32
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 17627
39
Android Eclipse IDE Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Minh Hoang
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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,
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic