R cannot be resolved

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

R cannot be resolved

Postby nmesisca » Thu Apr 09, 2009 1:16 pm

Hi all,
im a bit of a noob with Android so please go easy on me :P
I installed Eclipse G. (3.4 I think the last version) and the ADP, and the SDK (1.1 r1). Changed the path in the env variables under win xp sp3.
All is good until I try to create a new Android project.
In the problems tab I see the error "R cannot be resolved". I searched (here and other sites) but none of the 'workarounds' has worked.
Could someone please help ??
I have tried re-installing Eclipse too but no joy.

thanks all for the help,
N
nmesisca
Freshman
Freshman
 
Posts: 8
Joined: Thu Apr 09, 2009 12:30 pm
Location: Dublin

Top

Postby WarrenFaith » Thu Apr 09, 2009 2:12 pm

Simply check your xml files for errors.
If the xml files are fine, the class R will automatically be generated.
WarrenFaith
Moderator
Moderator
 
Posts: 227
Joined: Fri Mar 13, 2009 10:59 am
Location: Berlin, Germany

xml

Postby nmesisca » Thu Apr 09, 2009 2:52 pm

WarrenFaith wrote:Simply check your xml files for errors.
If the xml files are fine, the class R will automatically be generated.



thanks for your answer mate, can i check the XML from eclipse itself or do I have to root in the project folder manually?
sorry for the noob question.

N
nmesisca
Freshman
Freshman
 
Posts: 8
Joined: Thu Apr 09, 2009 12:30 pm
Location: Dublin

Postby WarrenFaith » Thu Apr 09, 2009 3:01 pm

Have you installed ADT (Android Development Tools) for Eclipse?
If yes, Eclipse should show you every error, if not, try to install ADT and you will see the errors.
WarrenFaith
Moderator
Moderator
 
Posts: 227
Joined: Fri Mar 13, 2009 10:59 am
Location: Berlin, Germany

Postby nmesisca » Thu Apr 09, 2009 3:15 pm

WarrenFaith wrote:Have you installed ADT (Android Development Tools) for Eclipse?
If yes, Eclipse should show you every error, if not, try to install ADT and you will see the errors.



I installed the android plugin (0.8) and can choose android project in the New project dialog.
but the only error i see in the problem tab is the R cannot be resolved one..

:(
nmesisca
Freshman
Freshman
 
Posts: 8
Joined: Thu Apr 09, 2009 12:30 pm
Location: Dublin

Postby WarrenFaith » Thu Apr 09, 2009 3:19 pm

Ok, had that too :)

Reduce your java code to absolute minimum (comment it out), so R isn't needed. This should also enables the generation of R and you can remove the comments and try again.
WarrenFaith
Moderator
Moderator
 
Posts: 227
Joined: Fri Mar 13, 2009 10:59 am
Location: Berlin, Germany

Top

Postby nmesisca » Thu Apr 09, 2009 3:21 pm

WarrenFaith wrote:Ok, had that too :)

Reduce your java code to absolute minimum (comment it out), so R isn't needed. This should also enables the generation of R and you can remove the comments and try again.



I didnt add ANY code.. its the auto-generated Android project (Hello world)
nmesisca
Freshman
Freshman
 
Posts: 8
Joined: Thu Apr 09, 2009 12:30 pm
Location: Dublin

Postby WarrenFaith » Thu Apr 09, 2009 3:33 pm

But somewhere you have usage of R... remove that, this should work :)
WarrenFaith
Moderator
Moderator
 
Posts: 227
Joined: Fri Mar 13, 2009 10:59 am
Location: Berlin, Germany

understood

Postby nmesisca » Thu Apr 09, 2009 3:38 pm

WarrenFaith wrote:But somewhere you have usage of R... remove that, this should work :)


I see what you mean. Though being the auto generated project one would assume its not going to crap out like this.
I will try and will post back here to let you know.
Thanks again (for the moment ) :)

N
nmesisca
Freshman
Freshman
 
Posts: 8
Joined: Thu Apr 09, 2009 12:30 pm
Location: Dublin

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: Majestic-12 [Bot] and 8 guests