全新安装的Eclipse,R不能解析为一个变量 [英] Fresh install of Eclipse, R cannot be resolved to a variable

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

问题描述

我所遇到的R不能得到解决的错误无数次,但一直有一个简单的办法。对不起,麻烦你,但我难倒这个时候...

I have come across the "R cannot be resolved" error countless times but there has always been an easy fix. Sorry to trouble you but I'm stumped this time...

我最近决定双启动我的电脑进入Windows 7 / Ubuntu的(previously仅适用于Windows 7)并装载Eclipse进行我的Andr​​oid应用程序开发,但我遇到了臭名昭著的R 1不能得到解决的错误。

I recently decided to dual boot my computer into Windows 7/Ubuntu (previously Windows 7 only) and load Eclipse for my Android app development, however I came across the infamous R cannot be resolved error.

在一个干净的安装Ubuntu 12.10中,我设置谷歌的ADT包从Android开发者网站 。我安装了Eclipse,SDK和亚洲开发银行被列入包从上面下载了(ADT来到pre-安装/设置)。这是Eclipse中的一个特殊版本由谷歌提供,包括当Eclipse启动文本Android开发者工具。

After a clean install of Ubuntu 12.10, I set up Google's ADT Bundle from the Android Developer website. I installed the Eclipse, SDK and ADB that were included in the package from the above download (ADT came pre-installed/setup). This is a special version of Eclipse provided by Google and includes the text "Android Developer Tools" when Eclipse is started.

运行Eclipse的Java项目精细,SDK管理器似乎是正确的设置,因为我可以从Eclipse中直接启动它(我也安装了所有的Andr​​oid软件开发工具包1.5-4.2的),AVD管理几乎正常工作(它会启动,并允许我创造新的设备,但将无法启动的消息恐慌:无法打开:some_device),然而,任何Android项目将无法编译,并显示错误R不能解析为一个变量

Eclipse runs Java Projects fine, the SDK Manager seems to be set up correctly because I can launch it directly from Eclipse (I have also installed all of Android SDKs 1.5-4.2), AVD Manager almost works correctly (it launches and allows me to create new devices but will not start with the message "PANIC: could not open: some_device"), however any Android project will not compile with the error "R cannot be resolved to a variable".

我已经用我现有的Andr​​oid项目从我的两个老的工作空间,以及创造新的工作空间,但尝试都诉诸同样的错误。

I have tried using my existing Android projects from two of my old workspaces as well as creating a new workspace but they all resort to the same error.

有什么建议?我真的想开始一个基于Linux的环境中工作,并花了几个小时试图让这项工作...

Any advice? I would really like to begin working in a Linux-based environment and have spent several hours trying to get this to work...

我会强烈AP preciate任何人的想法/咨询/解决方案/可惜的/ etc。

I would highly appreciate anyone's ideas/advice/solutions/pity/etc.

编辑:我开始想下水的地方美国Android虚拟设备时,这个问题可能是连接到我的其他错误恐慌:无法打开:some_device。可悲的是我不知道是什么导致了这个也不知道怎样去解决它要么...

I'm starting to think this problem is probably connected to my other error when launching an Android Virtual Device where it states "PANIC: could not open: some_device". Sadly I have no idea what's causing this nor how to fix it either...

推荐答案

我有同样的问题。全新安装ADT捆绑,创造使用向导创建新项目,是给我R不能解析为一个变量的错误。我试图在previous后一切都解释说。

I had the same issue. Fresh install of ADT Bundle, creating a new project using wizard, was giving me "R cannot be resolved to a variable" error. I tried everything explained in previous post.

在我的具体情况,这是我的Andr​​oid的SDK工具和ADT束指向一个另一个副本,而不是自带的包之一。我只是改变了这一点,所有的项目再次进行了合作。希望这有助于。

In my particular case, it was that I had another copy of Android SDK tools and ADT Bundle was pointing to that one, instead of the one that comes with the bundle. I just changed that, and all projects were working again. Hope this helps.

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

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