R舱从现有源创建的Android项目后失踪 [英] R class missing after creating android project from existing source
问题描述
我下载的源SpriteMethodTest,我想它建立在Eclipse。于是我去:
I downloaded the source for SpriteMethodTest, and I want to build it in Eclipse. So I Went:
文件>>新建>> Android项目>>创建项目从现有源代码>> SpriteMethodTest
File >> New >> Android Project >> Create Project From Existing Source >> SpriteMethodTest
它创建的项目还好,但不产生R类。引用R中的资源的任何文件说研究解决不了
。
It created the project alright, but the R class is not generated. Any file that references a resource in R says R cannot be resolved
.
导入android.R只是导致 R.drawable.background无法解析
。怎样才能再次产生R个?
Importing android.R just results in R.drawable.background cannot be resolved
. How do I generate R again?
推荐答案
您有一个问题,因为你要导入机器人研究
,不是你的项目的具体<$ C $ ç>研究。只需删除进口android.R;
,然后将鼠标悬停在提及被赋予研究不能被解析为一个变量第r
。从那里,你将有其中R导入可能一些不同的选择。你想导入是在R的您的包中。
You are having an issue because you are importing Androids R
, not your project specific R
. Simply delete the import android.R;
, then hover your mouse over the reference to the R that is giving the R cannot be resolved to a variable
. From there you will have possibly a few different options on which R to import. You want to import the R that is in your package.
这篇关于R舱从现有源创建的Android项目后失踪的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!