Android的 - R的不能被解析到一个变量 [英] Android - R cannot be resolved to a variable

查看:116
本文介绍了Android的 - R的不能被解析到一个变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能重复:
   R能够解决不了 - Android的错误

我有我以前有一个问题,我不明白原因。我的项目和code是罚款,因为它是运行昨天。我打开Eclipse今天和整个项目看起来像它包含错误。

I am having a issue which I have had before and I don't understand the cause. My project and code is fine as it was running yesterday. I have open Eclipse today and the whole project looks like it contains errors.

我相信这是某种形式的构建路径问题。我不明白为什么它随机发生?但在code其中有 R.Layout.LayoutName 有一个问题...谁能帮助?

I believe it is some sort of build path issue. I don't understand why it randomly occurs? But in the code where there is R.Layout.LayoutName there is an issue... can anyone help?

我已经试过清洁和构建它,我已经试过进口android.R但我以前没有这种情况,然后给出和错误,并说布局文件不存在。

I have tried cleaning and building it, I have tried importing android.R but I didn't have this before, it then gives and error and says the layout file doesn't exist.

推荐答案

您针对android.R还是一个在自己的项目?

Are you targeting the android.R or the one in your own project?

您确定自己的R.java文件生成?在XML的观点错误,可能导致无法生成的R.java。穿过你的视图文件,并确保所有的XML是正确的!

Are you sure your own R.java file is generated? Mistakes in your xml views could cause the R.java not to be generated. Go through your view files and make sure all the xml is right!

这篇关于Android的 - R的不能被解析到一个变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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