generated java File ERROR

4 replies [Last post]
vibes35
Joined: 01/05/2010
User offline. Last seen 29 weeks 19 hours ago.

Ok.. this may be a no brainer to some but i am beating my head against the wall!

I import a project file via the 'Create project from existing source' into eclipse for development

I get an error with the Generated java Files saying that the type R is already defined from the project.

I am just trying to work through some basic tutorials!
Thanks for any help or insight into the matter!

Also, the only fix i have found is to comment out the gen - java file and then run a compile at which time it fixes itself! That can't be the right fix?!

Robert Green
Robert Green's picture
Joined: 02/18/2009
User offline. Last seen 21 hours 35 min ago.
Do a project clean. That

Do a project clean. That usually works.

R is a file that resides in your gen directory and is a bunch of pointers to dex resources. You want Eclipse/ADT to generate it for you always.

vibes35
Joined: 01/05/2010
User offline. Last seen 29 weeks 19 hours ago.
ok...

Alright... so that is why it works when I comment out the code for that file and run the compiler.

I tried to delete the file directory within Eclipse but it auto builds itself back.

So I guess the way to handle this issue is to delete the current gen directory and then create project from an existing source.

:) Thanks! I am amazed at the speed you respond to the question here! You must be online like me almost all day :)

Robert Green
Robert Green's picture
Joined: 02/18/2009
User offline. Last seen 21 hours 35 min ago.
No Problem!

I'm glad that worked for you.

Yes, I'm online all the time. Between the 4 Android devices I have, my laptop and my netbook, I'd say I'm fairly well plugged in :)

vibes35
Joined: 01/05/2010
User offline. Last seen 29 weeks 19 hours ago.
Nice!

I know how that goes! I work full time producing architectural renderings and freelance design.

I must say that your site has been the highlight find of the day! I really want to extend my 3d knowledge into interactive device driven apps!

Thank you for all your help :)