Ash1
Ash1

Reputation: 91

How to add SDK files manually that needs a package.xml in android studio?

I have just installed Android studio and it needs to download some SDK files. But my internet connection is slow and the download keeps failing.
so I took the links and downloaded all SDK files manually with my download manager and then I unzipped them and put them in SDK path which in my case is:
C:\Users\USERNAME\AppData\Local\Android\Sdk
the problem is when I open Android studio it still downloads these SDK files. I don't know how to tell android studio that these files are already downloaded. Can anyone solve this? Android Studio that I am using is version 4.0.0.

Check the images for more information:

enter image description here

And when I click the edit:

enter image description here

And after clicking next:

enter image description here

Upvotes: 1

Views: 2720

Answers (3)

Ash1
Ash1

Reputation: 91

I finally figured it out. the SDK manager add a package.xml with some details after it download the sdk components and unzipped them. so manually unzipping sdk components to sdk folder won't work because sdk manager won't know if the component is already installed and it tries to download it again. (note: not all sdk components need a package.xml and work properly if you manually unzip them into sdk folder.)
Solution:

1- you should download the components manually with a download manager if you don't have the sdk components zip files. you can get the files link from the sdk download log:

enter image description here

2- wait until the downloading of that specific component fails. like in the picture

enter image description here

3- then the sdk manager start the download of another component, in the meantime you should go to sdk folder and inside .temp folder you would see folders with names like packageOperation followed by a number. in each one of this folders is a sdk component download file (in our case failed download) that probably has an extension of .asdownload.

4- Delete the file with .asdownload and paste your fully downloaded zip file.

5- you can follow the steps for every sdk component. at the end the sdk manager will give you a retry option if there was any failed downloads. click retry, this time the sdk manager won't download the sdk files that failed (because of the sdk zip files that we manually pasted inside packageOperation folders) and it automatically installs them.

enter image description here

and that's it. you should see sdk components finishes successfully.

enter image description here

Upvotes: 2

s.mhmd
s.mhmd

Reputation: 307

Android SDK >> Android SDK location >> Edit >>(C:\Users\USERNAME\AppData\Local\Android\Sdk)

then click Apply >> Ok

Upvotes: 0

Abhimanyu
Abhimanyu

Reputation: 14937

In Android Studio Settings -> Appearance & Behaviour -> System Settings -> Android SDK.

In this, there will an option for Android SDK location. Choose the directory of your Android SDK & it will use the SDK from that location.

Note: I am using 4.1 canary 10. In case, you don't find the setting in the above-mentioned path, open Android Studio, and search for SDK.

Upvotes: 0

Related Questions