class R disappeared and impossibility to generate it again

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

class R disappeared and impossibility to generate it again

Postby bertignac » Mon Feb 15, 2010 4:07 pm

Hello,


I had the bad idea to right click on my eclipse android project and change the project build target on properties, to a more recent version.
After this operation, my class R on /gen disappeared and I can't build the project because of errors due to the absence of R class (In fact, eclipse is not able to bind my strings and drawables ressources without R class ).
I tried to delete /gen and build but I don't succeed to get back my project to normal, to recover R class.

Does somebody has an idea?

Thanks in advance,

bertignac
bertignac
Junior Developer
Junior Developer
 
Posts: 14
Joined: Thu Feb 11, 2010 7:18 pm

Top

Postby Mino » Mon Feb 15, 2010 4:47 pm

Hi,

You basically got stuck in an evil circle. aapt generates R from the xml files, if resources referenced in an xml can't be found the generation fails. In your case the resources can't be found because R is gone...

My only suggestion is to comment our the sections in your xml files that references resources. Build once to get R back. Then uncomment and build again.
Mino
Once Poster
Once Poster
 
Posts: 1
Joined: Mon Feb 15, 2010 4:20 pm

Postby bertignac » Mon Feb 15, 2010 5:15 pm

Hi,

Thanks for your answer.
I did it. I didn't have any new trouble with xml files, and the R class is generated again.
I had to recreate some enums that were not visible anymore for the other classes in the same package/
Strange!

IT'S FIXED!!!

Thanks,

bertignac
bertignac
Junior Developer
Junior Developer
 
Posts: 14
Joined: Thu Feb 11, 2010 7:18 pm

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: Exabot [Bot] and 4 guests