缺少即使项目清理R.java文件 [英] Missing R.java file even though project cleaned

查看:108
本文介绍了缺少即使项目清理R.java文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在code每一次,我有一个R,我得到一个错误R 1不能被解析到一个变量。

Every time in code that I have an R, I get an error R cannot be resolved to a variable.

在R.java文件似乎丢失。

The R.java file appears to be missing.

我试图清理项目。

推荐答案

当你在你的XML文件中的一个错误可能发生这种情况(例如,资源无法找到)。这也可能发生通过菜单来使用的,因为(我有,因为菜单的这个问题,我不得不删除它们,干净,再次加入)。而另一个可能的原因是,你最初想有你的R舱没有在它创建的​​默认位置,但在自己的包。因此,它是可能的,R的默认位置创建您的程序正在寻找它在其他地方。

This can happen when you have an error in one of your xml files (for example, a resource cannot be found). This can also happen because of using menus (I have had this problem because of menus, and I had to remove them, clean and add them again). And another possible reason is that you initially wanted to have your R class not in the default place where it is created but in your own package. So it is possible that R is created in its default location and your program is looking for it somewhere else.

这篇关于缺少即使项目清理R.java文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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