R能够解决不了 - Android的,没有进口android.R;声明 [英] R cannot be resolved - Android, no import android.R; statement

查看:140
本文介绍了R能够解决不了 - Android的,没有进口android.R;声明的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好吧, 我工作的一个新的应用程序,一切细微的工作,只要我用相对的观点。不过,我想一个标签式布局,所以我打开了我有(没有多少,到目前为止,因为我刚刚从一个数据库,并设置工作读)以上选项卡视图。自那时起,即有任何R.声明任何类有一个R无法得到解决的错误。我下面从Android的Hello视图的教程,所以我假定教程不是问题(但它仍然可能是)。

Ok, I am working on a new app and everything worked fine as long as I used a Relative View. However, I want a tabbed layout so I switched what I had (not much so far since I just got it reading from a DB and settings working) over to a tabbed view. Since that time, any class that has any R. statement in it has an "R cannot be resolved" error. I am following the tutorial from the Android "Hello Views" tutorial so I am assuming that isn't the issue (but it could still be).

推荐答案

我有几个建议:

  1. 请确保你没有比R-相关的错误之外的任何其他错误。用鼠标右键单击在Eclipse项目文件夹,Android的工具 - >修复项目属性

  1. Make sure you don't have any other errors other than the R-related errors. Right-click your project folder in Eclipse, Android Tools -> Fix Project Properties.

检查以确保您有正确的 - [R导入。有时默认Android.R可以导入。

Check to make sure you have the correct R imported. Sometimes the default Android.R can be imported.

为您在布局XML文件中的错误。

Check for errors in your layout XML files.

这篇关于R能够解决不了 - Android的,没有进口android.R;声明的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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