Android的Eclipse的 - 运动项目造成的一切R参考错误 [英] Android Eclipse - moving project caused all R reference errors

查看:132
本文介绍了Android的Eclipse的 - 运动项目造成的一切R参考错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我把我的Eclipse项目通过右键单击项目>重构>移动。这引起了(起初)感叹号以示旁边的项目名称。所以,我重新启动Eclipse的。这样取出exclmation大关,但现在我的整个活动文件的R.引用有错误。我想:

I moved my project on Eclipse by Right Click project > Refactor > Move. This caused (at first) an exclamation mark to show next to project name. So I restarted Eclipse. This removed the exclmation mark, but now my entire Activity file's R. references have errors. I tried:

  1. 删除R.java文件,它会自动重新生成。

  1. Deleting R.java file and it regenerated automatically.

清理项目几次。

变更后的目标构建设置来回。仍然没有运气。

Changed target build set back and forth. Still no luck.

有没有错误,其他任何地方。里面的src \ COM只是我MainActivity文件。*文件夹。

There are no errors anywhere else. Just my MainActivity file inside src\com.* folder.

推荐答案

检查是否要导入 android.R ,而不是你产生研究类。

Check if you are importing android.R instead of your generated R class.

使用Eclipse

注:Eclipse中有时喜欢添加导入android.R语句文件使用资源的顶部,尤其是当你问蚀进行排序或以其他方式管理进口。这将导致你的化妆打破。寻找出这些错误的import语句,并删除它们。

Note: Eclipse sometimes likes to add an import android.R statement at the top of your files that use resources, especially when you ask eclipse to sort or otherwise manage imports. This will cause your make to break. Look out for these erroneous import statements and delete them.

在另一方面,检查是否有在一个XML文件中的任何错误(但shouldn't让你产生 R.java 文件)

In the other hand, check if you have any errors in a xml file (but it shouldn´t allow you to generate the R.java file)

这篇关于Android的Eclipse的 - 运动项目造成的一切R参考错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆