momo
momo

Reputation: 3935

R.java not being created

So I've been working on this project all day, and no problems. I add an id to a layout element in one xml file, which is not being recognized by the IDE (all other IDs are, but this one isn't). I've run into things like this before over the past couple days, and a "Project > Clean" usually fixed it. So I did so - and virtually every one of my files that references R.anything comes up with the red X - I look and see that R.java isn't being created.

I searched SO and found a couple solutions about turning on or off "Build Automatically" and tried that - no luck - someone else said try setting target to 2.2 - tried that, no luck. Tried deleting it manually, tried recreating it and adding it as source - no good. Restarted eclipse, and tried everything again, without success.

As I said, I must have compiled this thing 100 times tonight, and the only change I made between working fine and failing is adding an id to an element (which I've since removed).

Upvotes: 0

Views: 1295

Answers (1)

Jave
Jave

Reputation: 31846

If you have a corrupt XML-file and try to rebuild your R.* it will fail. You should go through your xml-files and make sure that they are all error-free.
It's likely you have a misspelling or other small problem somewhere that prevents the build.

Upvotes: 7

Related Questions