Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot add compatibility package to android project

I'm having trouble adding the compatibility package to my android project.

Not really sure what to do about this. Any ideas are appreciated. The error happens at the bottom where it seems like a connection to my localhost is refused.

This is the console output I see:

[2011-11-12 01:44:13 - SDK Manager] Fetching https://dl-ssl.google.com/android/repository/addons_list-1.xml
[2011-11-12 01:44:14 - SDK Manager] Validate XML
[2011-11-12 01:44:14 - SDK Manager] Parse XML
[2011-11-12 01:44:14 - SDK Manager] Fetched Add-ons List successfully
[2011-11-12 01:44:14 - SDK Manager] Fetching URL: https://dl-ssl.google.com/android/repository/repository-5.xml
[2011-11-12 01:44:15 - SDK Manager] Validate XML: https://dl-ssl.google.com/android/repository/repository-5.xml
[2011-11-12 01:44:15 - SDK Manager] Parse XML:    https://dl-ssl.google.com/android/repository/repository-5.xml
[2011-11-12 01:44:15 - SDK Manager]     Found SDK Platform Android 1.1, API 2, revision 1 (Obsolete)
[2011-11-12 01:44:15 - SDK Manager]     Found SDK Platform Android 1.5, API 3, revision 4
[2011-11-12 01:44:15 - SDK Manager]     Found SDK Platform Android 1.6, API 4, revision 3
[2011-11-12 01:44:15 - SDK Manager]     Found SDK Platform Android 2.0, API 5, revision 1 (Obsolete)
[2011-11-12 01:44:15 - SDK Manager]     Found SDK Platform Android 2.0.1, API 6, revision 1 (Obsolete)
[2011-11-12 01:44:15 - SDK Manager]     Found SDK Platform Android 2.1, API 7, revision 3
[2011-11-12 01:44:15 - SDK Manager]     Found SDK Platform Android 2.2, API 8, revision 3
[2011-11-12 01:44:15 - SDK Manager]     Found SDK Platform Android 2.3.1, API 9, revision 2 (Obsolete)
[2011-11-12 01:44:15 - SDK Manager]     Found SDK Platform Android 2.3.3, API 10, revision 2
[2011-11-12 01:44:15 - SDK Manager]     Found SDK Platform Android 3.0, API 11, revision 2
[2011-11-12 01:44:15 - SDK Manager]     Found SDK Platform Android 3.1, API 12, revision 3
[2011-11-12 01:44:15 - SDK Manager]     Found SDK Platform Android 3.2, API 13, revision 1
[2011-11-12 01:44:15 - SDK Manager]     Found SDK Platform Android 4.0, API 14, revision 1
[2011-11-12 01:44:15 - SDK Manager]     Found ARM EABI v7a System Image, Android API 14, revision 1
[2011-11-12 01:44:15 - SDK Manager]     Found Samples for SDK API 7, revision 1
[2011-11-12 01:44:15 - SDK Manager]     Found Samples for SDK API 8, revision 1
[2011-11-12 01:44:15 - SDK Manager]     Found Samples for SDK API 9, revision 1 (Obsolete)
[2011-11-12 01:44:15 - SDK Manager]     Found Samples for SDK API 10, revision 1
[2011-11-12 01:44:15 - SDK Manager]     Found Samples for SDK API 11, revision 1
[2011-11-12 01:44:15 - SDK Manager]     Found Samples for SDK API 12, revision 1
[2011-11-12 01:44:15 - SDK Manager]     Found Samples for SDK API 13, revision 1
[2011-11-12 01:44:15 - SDK Manager]     Found Samples for SDK API 14, revision 1
[2011-11-12 01:44:15 - SDK Manager]     Found Android SDK Platform-tools, revision 9
[2011-11-12 01:44:15 - SDK Manager]     Found Android SDK Tools, revision 15
[2011-11-12 01:44:15 - SDK Manager]     Found Documentation for Android SDK, API 14, revision 1
[2011-11-12 01:44:15 - SDK Manager]     Found Android Support package, revision 4
[2011-11-12 01:44:15 - SDK Manager] Fetching URL: https://dl-ssl.google.com/android/repository/addon.xml
[2011-11-12 01:44:15 - SDK Manager] Validate XML: https://dl-ssl.google.com/android/repository/addon.xml
[2011-11-12 01:44:15 - SDK Manager] Parse XML:    https://dl-ssl.google.com/android/repository/addon.xml
[2011-11-12 01:44:15 - SDK Manager]     Found Google APIs by Google Inc., Android API 3, revision 3
[2011-11-12 01:44:15 - SDK Manager]     Found Google APIs by Google Inc., Android API 4, revision 2
[2011-11-12 01:44:15 - SDK Manager]     Found Google APIs by Google Inc., Android API 5, revision 1 (Obsolete)
[2011-11-12 01:44:15 - SDK Manager]     Found Google APIs by Google Inc., Android API 6, revision 1 (Obsolete)
[2011-11-12 01:44:15 - SDK Manager]     Found Google APIs by Google Inc., Android API 7, revision 1
[2011-11-12 01:44:15 - SDK Manager]     Found Google APIs by Google Inc., Android API 8, revision 2
[2011-11-12 01:44:15 - SDK Manager]     Found Google APIs by Google Inc., Android API 9, revision 2 (Obsolete)
[2011-11-12 01:44:15 - SDK Manager]     Found Google APIs by Google Inc., Android API 10, revision 2
[2011-11-12 01:44:15 - SDK Manager]     Found Google APIs by Google Inc., Android API 11, revision 1
[2011-11-12 01:44:15 - SDK Manager]     Found Google APIs by Google Inc., Android API 12, revision 1
[2011-11-12 01:44:15 - SDK Manager]     Found Google APIs by Google Inc., Android API 13, revision 1
[2011-11-12 01:44:15 - SDK Manager]     Found Google APIs by Google Inc., Android API 14, revision 1
[2011-11-12 01:44:15 - SDK Manager]     Found Google TV Addon by Google Inc., Android API 12, revision 2
[2011-11-12 01:44:15 - SDK Manager]     Found Google Market Licensing package, revision 1
[2011-11-12 01:44:15 - SDK Manager]     Found Google USB Driver package, revision 4
[2011-11-12 01:44:15 - SDK Manager]     Found Google Market Billing package, revision 1
[2011-11-12 01:44:15 - SDK Manager]     Found Google Admob Ads Sdk package, revision 4
[2011-11-12 01:44:15 - SDK Manager]     Found Google Webdriver package, revision 2
[2011-11-12 01:44:15 - SDK Manager] Fetching URL: http://www.echobykyocera.com/download/echo_repository.xml
[2011-11-12 01:44:15 - SDK Manager]   Failed to fetch URL http://www.echobykyocera.com/download/echo_repository.xml/addon.xml, reason: Connection to http://127.0.0.1:8888 refused
[2011-11-12 01:44:15 - SDK Manager] Fetching URL: http://developer.lgmobile.com/sdk/android/repository.xml
[2011-11-12 01:44:15 - SDK Manager]   Failed to fetch URL http://developer.lgmobile.com/sdk/android/repository.xml/addon.xml, reason: Connection to http://127.0.0.1:8888 refused
[2011-11-12 01:44:15 - SDK Manager] Fetching URL: http://innovator.samsungmobile.com/android/repository/repository.xml
[2011-11-12 01:44:15 - SDK Manager]   Failed to fetch URL http://innovator.samsungmobile.com/android/repository/repository.xml/addon.xml, reason: Connection to http://127.0.0.1:8888 refused
[2011-11-12 01:44:15 - SDK Manager] Fetching URL: http://developer.sonyericsson.com/edk/android/repository.xml
[2011-11-12 01:44:16 - SDK Manager]   Failed to fetch URL http://developer.sonyericsson.com/edk/android/repository.xml/addon.xml, reason: Connection to http://127.0.0.1:8888 refused
[2011-11-12 01:44:16 - SDK Manager] Done loading packages.
[2011-11-12 01:44:16 - Android Compatibility JAR not found:] /apps/eclipse64/Eclipse.app/Contents/MacOS/v4/android-support-v4.jar
like image 812
Nelson Ramirez Avatar asked Nov 12 '11 06:11

Nelson Ramirez


2 Answers

In Eclipse, you can create a "user library", add the compatibility jar you need (v4 or v13) and add this user library in your build path. Below a short step plan:

  1. From menu, select Project -> Properties
  2. Select "Java Build Path"
  3. Go to "Libraries" tab, and select "Add Library"
  4. Select "User Library"
  5. Select "User Libraries"
  6. select "New"
  7. Give your library a name, like "Android-Compatibility-v4"
  8. Once create in left pane, press Add JARS
  9. Choose the compatibility jar, like D:\Programs\android-sdk-windows\extras\android\support\v4\android-support-v4.jar
  10. You are back to User Libraries pane. select "Ok". You will see this new user library added and checkbox selected. Press "finish". Press "Ok"

Your project should now have the compatibility jar added in build path. Note. Pressing "Android Tools" -> "Add Compatibility Libraries" will still not work, but at least your project now includes the required library and you can work.

Second option is to create a Lib and add the jar in there: http://developer.android.com/sdk/compatibility-library.html (Setting Up a Project to Use a Library)

like image 80
Developerx Avatar answered Oct 22 '22 13:10

Developerx


I was missing this mysterious "extras" folder in the SDK, so I couldn't do Developerx's solution.

The way to get it is to:

  1. Run the "android" program in your <sdk>/tools/ folder. This brings up the "Android SDK Manager".
  2. Near the bottom of the screen, expand the "Extras" folder, and select the checkbox for "Android Support Package".
  3. Click "Install 1. package..", and when it's done you should now have the "extras" folder containing "android-support-v4.jar".
like image 23
Lavamantis Avatar answered Oct 22 '22 13:10

Lavamantis