Any Android developers who chose to not adopt Android Studio and continue using Eclipse will eventually face the dreadful problem of the workspace not loading properly. The most common jobs who tend to get stuck are: Android SDK: Resolving error markers... and Android SDK Content Loader, which sometimes hangs at 0% or 100% of their completion and also tend to completely block the GUI when it's the case.
The first thing to try when this happens is to run Eclipse with the -clean and -refresh command-line options enabled:
1 |
"C:\Program Files\Android SDK\Eclipse\eclipse" -clean -refresh |
There is a fair chance that this simple method will solve the issue. Since it tends to happen a lot it would be advisable to put the trick in a batch file in the Eclipse root folder (i named mine eclipse.clean.refresh.bat):
1 2 3 4 |
@echo off cd %CD% eclipse -clean -refresh exit |
There are, however, scenarios in which this method doesn't work. When such situations arise we need to switch to a more aggressive approach, deleting the cache files built by the SDK in the .android folder which is located inside the current user profile files. Here's the updated batch file to fullfill the task:
1 2 3 4 5 6 7 8 |
@echo off set ECLIPSEFOLDER=%CD% cd /D %USERPROFILE%/.android rd /s /q cache del ddms.cfg /f cd /D %ECLIPSEFOLDER% eclipse -clean -refresh exit |
Before executing any of these commands ensure that the Eclipse process is properly closed, otherwise the files and the workspace will be locked: if you cannot do that gracefully, use the "Kill Process" option in Task Manager instead.