我已经在OS X 10.8.2上使用Eclipse 4.2 (Juno release 20120920-0800)工作了几周,为Android 3.0及以上版本构建应用程序。我有一台带SSD的四核i7 MacBook Pro,所以性能不是问题。一切都很好。

在某种程度上,我导入了一个需要Android 2.2的Android项目,所以我使用Android SDK管理器安装了它(v.21)。从那时起,使用Eclipse的工作就一直在进行。首先,它将在右下角的状态消息中打印以下内容:

Android SDK内容加载器:(0%)

这需要两分钟左右。具体的消息是“检查项目”,当它这样做的时候,所有的Android项目都以红色突出显示,因为Android资源没有找到。然后,它继续:

Android 2.2加载数据(100%)

这个要放几分钟。然后它继续对我安装的Android 3.1和其他SDK版本进行同样的操作。它基本上挂起每当第一次自动完成踢(例如键入系统后)或当我访问Android首选项之前,它已经加载。

这是我的Android SDK的状态:

我已经尝试过的:

重新安装Android SDK(通过Homebrew),从而完全删除/usr/local/Cellar/android-sdk。 重新安装AVD插件(v.21)。

我能做些什么来找出这些问题的根源,并恢复到良好和干净的状态?


当前回答

我知道这个问题已经解决了,但我想分享一下这个链接:

Solution One Often times, this problem can be network related. Check if your network is behind a proxy. If so, you need to configure proxy on Eclipse. For that, go to “Windows” -> “Preferences” -> “General” -> “Network Connections”, and fill in your proxy info. Restart Eclipse after that. Conversely, it’s also possible that you have configured proxy on Eclipse before, but that you are no longer behind proxy. Make sure to disable proxy then. Solution Two Another solution is to clean up project-specific meta data directories which are stored under your workspace directory. $ cd workspace/.metadata/.plugins/org.eclipse.core.resources/.projects $ rm -rf * Restart Eclipse. Solution Three Check if an adb process is running. If so, kill the adb process, and restart Eclipse. Solution Four Try deleteing the contents of the cache folder located in user profile under .android\cache Try deleteing the ddms.cfg located in user profile under .android

其他回答

事实证明,当你的网络连接不稳定、速度慢等时,这个问题确实会发生。

只要我恢复正常的网络连接,内容就会在不到几秒钟的时间内正常加载。

这就是我重新开始工作的原因:

解决了android-support-v4.jar不同版本的问题。如果项目是相关的,它们就会出现不匹配的问题。

第二个不那么明显:我从shell中重新启动IDE,提供$ANDROID_SDK_HOME -环境变量。 这让我更进一步,但ide挂在不同的位置。 提供$ANDROID_HOME最终让我再次走上正轨。

顺便说一句:在这个过程之后,在接下来的IDE启动中就没有必要再次设置环境变量了。

我知道这个问题已经解决了,但我想分享一下这个链接:

Solution One Often times, this problem can be network related. Check if your network is behind a proxy. If so, you need to configure proxy on Eclipse. For that, go to “Windows” -> “Preferences” -> “General” -> “Network Connections”, and fill in your proxy info. Restart Eclipse after that. Conversely, it’s also possible that you have configured proxy on Eclipse before, but that you are no longer behind proxy. Make sure to disable proxy then. Solution Two Another solution is to clean up project-specific meta data directories which are stored under your workspace directory. $ cd workspace/.metadata/.plugins/org.eclipse.core.resources/.projects $ rm -rf * Restart Eclipse. Solution Three Check if an adb process is running. If so, kill the adb process, and restart Eclipse. Solution Four Try deleteing the contents of the cache folder located in user profile under .android\cache Try deleteing the ddms.cfg located in user profile under .android

成功了!我所做的就是打开终端,输入:

    cd documents/workspace/.metadata/.plugins

然后……输入

rm -rf

... 在。plugins类别中。

我做了这个批处理文件来完成slhck对Windows系统的回答所解释的任务:

@echo off
set ECLIPSEFOLDER=%CD%
cd /D %USERPROFILE%/.android
rd /s /q cache
del ddms.cfg /f
cd /D %ECLIPSEFOLDER%
eclipse -clean -refresh
exit

我在博客上的这篇文章中解释了这种方法。