在Eclipse中,构建一个Android应用程序时,我不小心删除的" R"类,不能让Eclipse来再重新生成 [英] In Eclipse, when building an Android app I've somehow deleted the "R" class and cannot get Eclipse to generate it again

查看:126
本文介绍了在Eclipse中,构建一个Android应用程序时,我不小心删除的" R"类,不能让Eclipse来再重新生成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新来的Eclipse / Android开发,所以我希望这是基本的东西,我只是在做错误的。基本上,我一直在玩弄开发Android应用程序,我是编辑一个更早。我改变了我的main.xml文件,当我回到我的类运行应用程序的R类的所有引用被打破。我看着在根文件夹(生成的Java文件),只见那类完全从溶液中消失了。

I'm new to Eclipse/Android development so I'm hoping this is something basic that I'm just doing wrong. Basically I've been playing around with developing Android apps and I was editing one earlier. I changed my main.xml file and when I went back to my class that runs the app all references to the "R" class were broken. I looked in the "gen" folder (Generated Java Files) and saw that the class was completely gone from the solution.

我已被前调试未5分钟,并没有这样做的任何问题。唯一的东西,因为调试是从绘制 - 华电国际文件夹中的文件夹资产2移动文件和我主编的main.xml中文件我做了。

I had been debugging not 5 minutes before and didn't have any problems doing so. The only things I had done since debugging were moving 2 files from the "drawable-hdpi" folder to the assets folder and I had edited the "main.xml" file.

我试着清理项目,并重新启动Eclipse的但既不这些思想工作。有什么建议?

I've tried cleaning the project and restarting Eclipse but neither of those ideas worked. Any suggestions?

推荐答案

检查您的main.xml文件。如果在它出现故障(无效的XML,错误的元素名称等),则R.java文件可能无法正确​​生成,您将有断开的引用。

Check your main.xml file. If there is a fault in it (invalid XML, wrong element name, etc), then the R.java file may not be generated properly and you will have broken references.

另外,还要确保XML文件本身并没有断开的引用(为字符串,颜色和其他类型的资产)。

Also make sure that the XML file itself does not have broken references (to strings, colors, and other kinds of assets).

重新审视一切正常自上次您的应用程序的工作改变了。

Re-examine properly all that has changed since the last time your application was working.

这篇关于在Eclipse中,构建一个Android应用程序时,我不小心删除的" R"类,不能让Eclipse来再重新生成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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