简体   繁体   English

Eclipse:Android应用程序中的大量错误

[英]Eclipse: Tons of Errors in Android Application

I imported my current Android Project to Eclipse on my (Mac OS) device via SVN. 我通过SVN在我的(Mac OS)设备上将当前的Android项目导入到Eclipse。 The code shows up alright, but Ecipse shows tons of errors (see screenshot) which do not appear on the device I first used - I am not very experienced with Eclipse but I guess some libraries were not imported? 该代码可以正常显示,但是Ecipse显示大量错误(请参见屏幕截图),这些错误不会出现在我最初使用的设备上-我对Eclipse不太熟悉,但是我想某些库没有导入? I installed the current JRE(1.7), Eclipse, the Android plugin which also installed the current Android SDK (4.1). 我安装了当前的JRE(1.7),Eclipse,这是Android插件,它也安装了当前的Android SDK(4.1)。 Any clues?! 有任何线索吗?

错误显示如下

  1. Right click on Project -> Android Tools -> Fix Project Properties 右键单击项目-> Android工具->修复项目属性
  2. Go to menu -> Project -> Clean 转到菜单->项目->清洁

For that go to each java file import all required packages or try CTRL + SHIFT + O 为此,请转到每个Java文件,导入所有必需的软件包,或尝试按CTRL + SHIFT + O

then resolve all errors in RES folder. 然后解决RES文件夹中的所有错误。

Then it will generate R.java for you 然后它将为您生成R.java

then import yourpakagename.R; 然后import yourpakagename.R; where ever required. 在任何需要的地方。

remove import android.R; 删除import android.R;

hope this will help you 希望这个能对您有所帮助

Place the sdk path in Window->Preference->android . 将sdk路径放在Window-> Preference-> android中

在此处输入图片说明 And then Click apply. 然后单击“应用”。 If you already do it. 如果您已经这样做。 Then right click the project and goto Properties->android->select android version 然后右键单击该项目,然后转到属性-> android->选择android版本

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

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