Search code examples
javaandroideclipseadtr.java-file

R.java won't generate, and there are no errors in resource files


After cleaning my project, my R.java file hasn't generated.

I've tried the following:

  1. Update eclipse. But my version is already up to date.
  2. Try cleaning the project again.
  3. Look for errors in my drawable XML files and layout files. I found none.
  4. Look through my Activity classes for errors; there were none except for the R.java references.

What else can I try?

I'm considering copy-pasting all of my classes, resources and manifest into a new project, but I'm wondering if there's anything else I can do.


Solution

  • So the strangest thing happened. I was randomly trying multiple things to get R.java back, and ended up right clicking ANOTHER project in my workspace (appcompat_v7, which I think was automatically generated), clicking properties, clicking Java Build Path, and checking some of the entries.

    I don't understand why this worked, but it did. If anyone could pitch in a reason though, that would be great.