Android的Eclipse的 - 运动项目造成的一切R参考错误运动项目、错误、Android、Eclipse

由网友(最佳损友@)分享简介:我把我的Eclipse项目通过右键单击项目>重构>移动。这引起了(起初)感叹号以示旁边的项目名称。所以,我重新启动Eclipse的。这样取出exclmation大关,但现在我的整个活动文件的R.引用有错误。我想:I moved my project on Eclipse by Right Click project...

我把我的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:

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

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

阅读全文

相关推荐

最新文章