• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

android in eclipse

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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



 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Saloon Keeper
Posts: 27752
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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,
 
Be reasonable. You can't destroy everything. Where would you sit? How would you read a tiny ad?
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic