0

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.

u3l
  • 3,342
  • 4
  • 34
  • 51
  • maybe there will be some problem in xml file – User11 May 29 '14 at 10:57
  • Check not only drawables and layouts... maybe strings, dimens, styles, ... Check for file names containing Upper Case letters or hyphens, too. – Phantômaxx May 29 '14 at 10:58
  • I've looked through everything. And there aren't any of those error symbols that eclipse displays next to a file, except for on files that mention `R.java` of course. – u3l May 29 '14 at 10:59
  • http://stackoverflow.com/questions/2757107/developing-for-android-in-eclipse-r-java-not-generating see thsi – User11 May 29 '14 at 10:59
  • 1
    What is valid xml may not be valid Android xml. What I mean is that what won't work for android may not be marked as an error in your IDE. – indivisible May 29 '14 at 13:27

2 Answers2

0

Try to import same project in another work space and then clean build it ,it has done trick for me might b helpfull to you

Aman Systematix
  • 347
  • 2
  • 10
0

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.

u3l
  • 3,342
  • 4
  • 34
  • 51