Nofalnss
Nofalnss

Reputation: 11

Failed updating SDK packages

Since it's a blocked site here, sdk manager can't reach dl.google.com/android, so I use a proxy.
But using a proxy make the internet speed not stable at all, which is very necessary for SDK manager to update and modify packages, so it always failed doing that.

So, I had downloaded packages from the same link it tries to download from, via download manager like IDM,

and here is my problem:

How I can tell SDK manager that here is you packages that you need to download, take it locally not over the internet?

Upvotes: 1

Views: 598

Answers (1)

chinmish
chinmish

Reputation: 99

This is a hack which I used a long time ago.

  1. In the Android Studio find Tools > Android > SDK Manager > SDK Update Sites.
  2. Click the + icon

Path 1-

  1. Instead of the url put your folder path Warning: This mostly doesn't work

Path 2-

  1. Install XAMPP
  2. Write this in an XML. For customizing XML you can take help from here for add-on SDK and here for essential SDK

Note: This snippet is for Add-On SDK

  <addon:sdk-addon>
     <remotePackage obsolete="false" path="add-ons;addon">
      <type-details xsi:type="addon:addonDetailsType">
        <api-level>3</api-level>
        <codename/>
        <vendor>
          <id>google</id>
          <display>Google Inc.</display>
        </vendor>
       <tag>
          <id>google_apis</id>
          <display>Google APIs</display>
        </tag>
        <libraries>
          <library localJarPath="maps.jar" name="com.google.android.maps">
            <description>****Put*fully*qualified*name*here****</description>
          </library>
        </libraries>
      </type-details>
      <revision>
        <major>3</major>
      </revision>
      <display-name>Google APIs</display-name>
      <uses-license ref="android-sdk-license"/>
      <channelRef ref="channel-0"/>
      <archives>
        <archive><!--Built on: Wed Nov  8 11:07:05 2017.-->
          <complete>
            <size>34908058</size>
            <checksum>CHANGE_THIS_CHECKSUM</checksum>
            <url>YOUR_FILENAME_GOES_HERE.zip</url>
          </complete>
        </archive>
      </archives>
    </remotePackage>
  </addon:sdk-addon>
  1. Now start XAMPP and run apache. Make sure you have set the directories correctly. Your directory must have the XML file
  2. Put the URL, probably something like localhost:8000/<YOUR_XML_FILENAME>.xml, of this file after clicking the + sign

I used this quite a while ago.

EDIT: I re-read your question and I didn't see very necessay part. By that I am guessing it is one of the Android SDK Tool. In your case your ****Put*fully*qualified*name*here**** might be "Android SDK Tools".

Also, the XML I wrote was for add-on SDKs. By the nature of your question you should edit the XML using essential SDK XML

I found a similar SOF QnA which you can look into

Upvotes: 1

Related Questions