R.java没有被创建 [英] R.java not being created

查看:109
本文介绍了R.java没有被创建的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我一直在做这个项目了一整天,没有任何问题。我想补充一个ID在一个XML文件中的布局元素,这是不是由IDE识别(所有其它ID是,但是这个人是不是)。之前我在过去几天已经遇到这样的事情,而项目>清除通常是固定的。所以,我这样做 - 而且几乎我的文件每一个引用R.anything想出了红色的X - 我看看,看看这是不是正在创建R.java

So I've been working on this project all day, and no problems. I add an id to a layout element in one xml file, which is not being recognized by the IDE (all other IDs are, but this one isn't). I've run into things like this before over the past couple days, and a "Project > Clean" usually fixed it. So I did so - and virtually every one of my files that references R.anything comes up with the red X - I look and see that R.java isn't being created.

我搜索SO,发现大约打开或关闭自动构建一对夫妇的解决方案,并尝试了 - 没有运气 - 别人说尝试设置目标2.2 - 试过,没有运气。尝试手动删除它,试图重建它,将其添加为源 - 没有好。重新启动Eclipse中,并再次尝试一切,都没有成功。

I searched SO and found a couple solutions about turning on or off "Build Automatically" and tried that - no luck - someone else said try setting target to 2.2 - tried that, no luck. Tried deleting it manually, tried recreating it and adding it as source - no good. Restarted eclipse, and tried everything again, without success.

正如我所说的,我必须编制这事儿,今晚100倍,唯一的变化我工作的罚款和失败是增加一个id为一个元素(我已经去掉以来)之间进行。

As I said, I must have compiled this thing 100 times tonight, and the only change I made between working fine and failing is adding an id to an element (which I've since removed).

推荐答案

如果您有一个损坏的XML文件,并尝试重建R. *将失败。你应该通过你的XML的文件,并确保它们都是无错的。照片很可能是你有一个拼写错误或其他小问题的地方,prevents构建。

If you have a corrupt XML-file and try to rebuild your R.* it will fail. You should go through your xml-files and make sure that they are all error-free.
It's likely you have a misspelling or other small problem somewhere that prevents the build.

这篇关于R.java没有被创建的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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