简体   繁体   中英

Android clean project deleted every R.java

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..

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).

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM