Tuesday, February 12, 2013

Android SDK Manager crash caused by jar files in classpath

My OS X Android SDK Manager was crashing whenever I tried to load a new API.  The log entry is shown below.

  1. Open the Android SDK Manager
  2. Select an API package (any package)
  3. Click "Install Packages"
  4. Get the error after a minute or so.

I tried restarting my Mac, running OnyX to fix permissions and purge unused memory, and running the SDK manager as administrator (sudo ./android).  I also checked for Eclipse updates but none were available.

The cause of this problem apparently was having one or more of these jar files in my classpath (/Library/Java/Extensions) - as soon as I removed all of these, the error went away:

  • commons-logging-1.1.1.jar
  • jul-to-slf4j-1.7.2.jar
  • junit-4.10.jar
  • log4j-over-slf4j-1.7.2.jar
  • slf4j-api-1.7.2.jar
  • slf4j-ext-1.7.2.jar
  • slf4j-jcl-1.7.2.jar
  • slf4j-migrator-1.7.2.jar

I had installed these files as part of my attempt to configure Eclipse for Robolectric framework testing of Android projects.  The Robolectric framework has undocumented dependencies on the Simple Logging Facade for Java (SLF4J) and the Apache Commons Logging Component.

Fetching URL: http://developer.android.com/guide/developing/tools/emulator.html
Done loading packages.
Fetching https://dl-ssl.google.com/android/repository/addons_list-2.xml
Preparing to install archives
Downloading SDK Platform Android 2.3.3, API 10, revision 2
Validate XML
Parse XML
Fetched Add-ons List successfully
Fetching URL: https://dl-ssl.google.com/android/repository/repository-7.xml
Unexpected Error installing 'SDK Platform Android 2.3.3, API 10, revision 2': java.lang.OutOfMemoryError: Java heap space
Downloading Samples for SDK API 10, revision 1
Done loading packages.
Unexpected Error installing 'Samples for SDK API 10, revision 1': java.lang.OutOfMemoryError: Java heap space
Skipping 'Intel x86 Atom System Image, Android API 10, revision 1'; it depends on 'SDK Platform Android 2.3.3, API 10, revision 2' which was not installed.
Skipping 'Google APIs, Android API 10, revision 2'; it depends on 'SDK Platform Android 2.3.3, API 10, revision 2' which was not installed.
Done. Nothing was installed.

No comments:

Post a Comment