简体   繁体   English

Android clean项目删除了每个R.java

[英]Android clean project deleted every R.java

I updated my SDK version via eclipse, after that i did a project clean. 我通过eclipse更新了SDK版本,之后我进行了项目清理。 Now every R.java class of all my projects is gone. 现在,我所有项目中的每个R.java类都消失了。

Hints like "some .xmls are wrong" doesn'T work, because i didnt change anything in the .xmls.. 诸如“某些.xml错误”之类的提示不起作用,因为我没有更改.xml中的任何内容。

What I did was go to Project --> Build Project 我所做的就是去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. File --> Import...然后导入没有R.java文件的项目。
  3. It will generate the R.java file for you. 它将为您生成R.java文件。 So either use this workspace, or copy and paste this R.java file into your old workspace that didn't have it. 因此,要么使用此工作空间,要么将此R.java文件复制并粘贴到没有该文件的旧工作空间中。 Save everything and possibly restart Eclipse. 保存所有内容,并可能重新启动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. 如果将adt更新为22,则在使用任何外部库时都会出现一个常见问题。

In ADT 22 by default external libraries are unchecked. 默认情况下,在ADT 22中,未选中外部库。

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 来源: https//plus.google.com/photos/117122118961369445953/albums/5878509263473846433/5878509268379848162?authkey = CL3Frb-S_qj-fQ

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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