Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse - Android not auto-generating R class

have an odd one..

Using Eclipse Juno, and everything was working fine for the last couple months. At some point yesterday, while Eclipse was cleaning my project, something crashed - popped up the Windows error reporting. (Didn't catch the name of what crashed..)

Now, I have no R.java class in /gen, and nothing I've tried will generate it. On top of that, when doing a clean rebuild of the project, the Output window remains blank. (No errors, no status message.. nothing.)

Tried just about everything - including the latest which included reinstalling Eclipse and then ADT. Still hadn't helped. (I have NOT tried clearing the workspace metadata yet, will do that soon.)

Any thoughts on what else to check?

--Fox.

Edit: Updating a random file - either .java or an XML layout/drawable does not have any effect, still nothing. Also, removing saved preferences from workspace .metdata data didn't have an effect either.

Edit 2: Okay - not sure WHY it was happening, but creating a new project and the issue was corrected.

So somehow either the project settings (.settings or project.settings) must have gotten corrupted. I have the origianl project still, and am curious to see why it happened, but creating a new project and copying sources and resources over, and no more issue.

Thanks to all that offered comments - goes to show that any kind of little corruption can cause strange things to happen.

like image 676
Coyttl Avatar asked Jan 11 '12 01:01

Coyttl


1 Answers

The reason in 99% of the cases is that you are missspelling something in some xml file. The R class file won't appear until all xml files are correct.

I suggest look carefully into your XMLs for a very small syntax error.

Or try taking off 1 by 1, until you figure it out wich one is the problematic.

:) kind of annoying, i know.

like image 123
InsaurraldeAP Avatar answered Sep 19 '22 16:09

InsaurraldeAP