0

I updated my SDK version via eclipse, after that i did a project clean. Now every R.java class of all my projects is gone.

Hints like "some .xmls are wrong" doesn'T work, because i didnt change anything in the .xmls..

Tommy
  • 27
  • 1
  • 1
  • 7
  • Try to restart eclipse,if it doesn't work, re-start your PC. – Manish Dubey Jul 06 '13 at 21:12
  • Might try `Build > Rebuild Project` and see – Shobhit Puri Jul 06 '13 at 21:19
  • 1
    If you have a compile error in an XML file the R.java will not be created. Fix all xml errors / compile errors, then do a `project > clean` – Blundell Jul 06 '13 at 21:23
  • i did everything you suggested, but it didnt work.. – Tommy Jul 06 '13 at 21:24
  • Have you checked the casing of the filenames of the XML files? For some reason, they have to be [a-z0-9] (lowercase alpha or numerals). [This question](http://stackoverflow.com/questions/2757107/developing-for-android-in-eclipse-r-java-not-generating?rq=1) also has some of the most common solutions. – BLaZuRE Jul 06 '13 at 21:41

2 Answers2

1

What I did was go to Project --> Build Project

That worked once. The second time it didn't. The second time, I did this:

  1. Create a brand new workspace.
  2. File --> Import... and import the project that didn't have the R.java file.
  3. It will generate the R.java file for you. So either use this workspace, or copy and paste this R.java file into your old workspace that didn't have it. Save everything and possibly restart Eclipse. It will work (even though it showed errors for a few minutes for me, they went away).
Michael Yaworski
  • 13,410
  • 19
  • 69
  • 97
0

If you have updated the adt to 22, then there is a common problem if you are using any external library.

In ADT 22 by default external libraries are unchecked.

Please right click on project > properties > android > java build path > order and export > check Android private libraries

Source: https://plus.google.com/photos/117122118961369445953/albums/5878509263473846433/5878509268379848162?authkey=CL3Frb-S_qj-fQ

Shrikant Ballal
  • 7,067
  • 7
  • 41
  • 61