简体   繁体   English

Hello World项目的Eclipse JUNO Build错误

[英]Eclipse juno Build error with hello world project

I am very new to android programming. 我对android编程非常陌生。 and started recently using Eclipse Juno with Win7 and I think its the latest release I have. 并且最近开始在Win7上使用Eclipse Juno,我认为它是我的最新版本。 downloaded Android SDK also.with all the updates and packages. 还下载了Android SDK,以及所有更新和软件包。

Now, while I am creating a new project with a simple way of creating a new project in eclipse, (it usually becomes the hello world program with blank template selection) and in file MainActivity.java It gives the following error : 现在,当我使用一种在eclipse中创建新项目的简单方法创建一个新项目时,(它通常会成为带有空白模板选择的hello world程序)并在文件MainActivity.java中它给出以下错误:

--> .R cannot be resolved to a variable MainActivity.java

I cant understand why this is happening. 我不明白为什么会这样。 can someone help ..please 有人可以帮忙吗..请

(I cant post picture as I am new) (我无法发布图片,因为我是新人)

thanks in advance 提前致谢

Clean the project if problem do not solve then watch the Problems bar aligned aside of "console" and "logcat". 如果问题无法解决,请清理项目,然后观察“控制台”和“ logcat”旁边的“ 问题”栏 I think it will be a problem with your project's resource like somewhere in your layout files or drawables or menus or values files or in Menifext file. 我认为这将是项目资源的问题,例如布局文件,可绘制对象,菜单或值文件或Menifext文件中的某个位置。 Also watch your java code imports . 还请注意您的Java代码导入 They should contain the import containing R like android.R or something like that. 它们应包含包含R(如android.R或类似名称)的导入。 If they contanins it then remove that import and clean again. 如果它们含有鞣质,则将其除去并再次清洁。 Your problem will be solved. 您的问题将得到解决。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM