0

I'm on a windows 8 os and trying to install android sdk from the cli. so far, I've downloaded all the essential tools listed here https://developer.android.com/studio/command-line/index.html along with platforms for android 7.1 and 8.0. I can't get the 901mb package directly from android studio for lack of enough bandwidth.

The instruction here https://androidsdkoffline.blogspot.com.ng/p/android-sdk-tools.html says android update sdk -t -u tools which I've done but it complains

Unrecognized argument "tools"

When I run only android update sdk, it tries downloading a bunch of xml files

Invoking "C:\Program Files\Android\Android Studio\Sdk\tools\bin\sdkmanager" --update Warning: Failed to connect to host: https://dl.google.com/android/repository/add ons_list-3.xml Warning: Failed to connect to host: https://dl.google.com/android/repository/add ons_list-2.xml Warning: Failed to connect to host: https://dl.google.com/android/repository/add ons_list-1.xml Warning: Failed to download any source lists! Warning: java.net.UnknownHostException: dl.google.com done

Which I've observed already exists in this folder "C:\Users\<username>\.android\cache". But even if it didn't there's no need to redownload those sdk tools when I already have them--I just need to point it to them.

I've tried adding the folders to my environment path variables list but it still has no effect. I noticed I have no build.gradle and idk where to get one. The commands on the sdkmanager page offer no help besides that dumb default behaviour of grabbing dependencies online at costly sizes, without regard to bandwidth costs of the developer. Is there some file I can tweak or some command I can run to intimate the sdk or android that these components it's looking for are right under its nose? I'm looking at a solution that may cause the sdkmanager to try to update from the internet as usual then resort to the local disk when it finds no internet connection; since I have the following folders in this directory "C:\Program Files\Android\Android Studio\Sdk": emulator, build-tools, platform-26_r01, android-7.1.1, tools, platform-tools, extras, licenses, patcher.

I also have the intel virtualization whatever dealt with (BIOS and co.), so someone kindly help me with the last piece of the puzzle. Many thanks!!

EDIT: I am seeing inconsistencies on blogs concerning this topic--some referring to C:\Program Files\Android\Android-Studio\Sdk and others to C:\Users\\AppData\Local\Android\Sdk . I'm currently operating from the latter since most sites used it but just to be safe, is there any difference between both?

I Want Answers
  • 371
  • 3
  • 15
  • Wherever you download the files from, it'll consume just as much bandwidth as the actual source. You don't need to download the emulator images if you have a physical device. And you don't need to download the sources or offline documentation. Excluding those will save you hundreds of MB – OneCricketeer Feb 11 '18 at 00:28
  • @cricket_007 In android studio, the budget to download reads an alarming 901mb. That's when I decided to obtain those required components from some kind folks who thought it wise to upload them at https://androidsdkoffline.blogspot.com.ng. My problem now is how to acquaint the android or sdk with these components or let it know it now has an sdk. Btw, I noticed I have no build.gradle. What process do I undergo to get that? Could it be the key to breaking the jinx and writing my first android code?? Please help me bro – I Want Answers Feb 11 '18 at 00:44
  • You get a `build.gradle` by actually making a new project. Android Studio itself will always be at least 700 MB in size, according to the download page. That's **not including** the additional SDK pieces. But you should use the graphically SDK Manager provided by the IDE, not the terminal. The terminal utilities won't help you write any code all by themselves. And the website you linked is not the current sdk version, which is why you're getting errors running commands because its documentation is outdated – OneCricketeer Feb 11 '18 at 02:48
  • I'm unable to write any code because Android studio startup redirects to the missing SDK (SDK setup wizard) which is where I see the dreadful download of items worth 901mb ALL PRESELECTED. I can't untick them so I studied the docs for those required and got them at smaller sizes. How do I get Android to recognize the SDK AND PROBABLY COMPLAIN IT'S OUTDATED???? That will be a step in the right direction. HOW DO I POINT ANDROID TO THOSE COMPONENTS, FOLDERS, BUILD TOOLS??? – I Want Answers Feb 11 '18 at 06:15
  • I'm unable to write any code because Android studio startup redirects to the missing SDK (SDK setup wizard) which is where I see the dreadful download of items worth 901mb ALL PRESELECTED. I can't untick them so I studied the docs for those required and got them at smaller sizes. How do I get Android to recognize the SDK AND PROBABLY COMPLAIN IT'S OUTDATED???? That will be a step in the right direction. HOW DO I POINT ANDROID TO THOSE COMPONENTS, FOLDERS, BUILD TOOLS??? – I Want Answers Feb 11 '18 at 06:15
  • 1
    https://stackoverflow.com/questions/16581752/android-studio-how-to-change-android-sdk-path – OneCricketeer Feb 11 '18 at 18:38

1 Answers1

0

What eventually worked was:

  • copying the entire contents of this folder from C:\Program Files\Android\Android-Studio\Sdk into C:\Users\username\AppData\Local\Android\Sdk

  • In environment variables, creating a new variable named ANDROID_HOME with the value set as C:\Users\username\AppData\Local\Android\Sdk

  • adding these new directories to the Path variable

    C:\Program Files\Android\Android-Studio\Sdk\tools\bin;C:\Users\username\AppData\Local\Android\Sdk\tools;C:\Users\username\AppData\Local\Android\Sdk\build-tools

  • The previous step causes this message to display on android studio setup wizard "An existing android sdk was detected. the setup wizard will only download missing or outdated components". Click on next and finish the wizard.

  • At the bottom of the screen, click on configure > project defaults > project structure. In the android sdk field, put C:\Users\username\AppData\Local\Android\Sdk and click "apply" then ok.

Everything now works well

I Want Answers
  • 371
  • 3
  • 15