Reputation: 3294
it's been a little while since I made an android project..
But recently I upgraded my eclipse version and a number of plugins etc..
Now all my projects won't compile and R cannot be resolved. ugh..
Upvotes: 1
Views: 726
Reputation: 4306
I had the same problem, here's the steps to solve: if you have the error in only one activity then jump to step 5. if all the activities have the same error then go step 1.
Upvotes: 1
Reputation: 943
This isn't a good answer. It's just what worked for me.
I just had the same problem a few days ago. Fixing R isn't the answer. I tried for a couple of hours. It won't work. Every id, every attr, every layout, every thing depends on R. Almost every statement in the code is red lined.
To fix it, I had to delete the workspace and start up a new one. Then restore everything from the last working backups. (If you don't already, Export the file structure about every couple of hours. Keep at least the last 3. It will save you someday.)
I think the problem occurred when I was working with the emulator. I was exiting from a hung start. I was going to restart after deleting an emulator that was junked up and recreate it. I exited Eclipse before clicking the 'not responding/cancel' message for the emulator. I didn't see the saving the environment progress bar from Eclipse when I stopped it. I think the workspace metadata or similar was blasted.
Upvotes: 1
Reputation: 100378
Look for problems that are not 'R' - related and fix them (these problems will prevent the R file from being built). Then clean your projects to invoke the generation of the R file.
Upvotes: 0