Skip to content

A Software Engineer's Logbook

Cloud Development, Productivity, and Learning

Menu
  • Home
Menu

Visual Studio 2015 install failures (Android SDK Setup) behind a Proxy

Posted on September 22, 2016June 22, 2018 by Pete

I was recently working with a customer trying to install Visual Studio 2015 in their corporate network which happened to be behind a firewall.  Access to the internet was restricted and provided with a proxy server that would allow some requests through the firewall.  When they tried to install Visual Studio 2015 on a developer desktop with the proxy configured correctly they were still seeing install failures.

The install failures showing in the UI were all the Android SDK API Levels.  These are installed for Cordova and Xamarin cross platform mobile development scenarios.

Looking deeper into the logs we would find errors like the following:

DownloadManager Error: 0 : Install return code for product 'Android SDK Setup (API Level 22)' is Failure (The following package(s) were not downloaded: build-tools-22.0.1 android-22 . Please check your internet connection and try again.) 
DownloadManager Information: 0 : Product Android SDK Setup (API Level 22) done install completed
DownloadManager Information: 0 : Increasing current install to 2
DownloadManager Information: 0 : Using execute progress heuristic for: Android SDK Setup (API Level 23)
DownloadManager Error: 0 : Install return code for product 'Android SDK Setup (API Level 23)' is Failure (The following package(s) were not downloaded: build-tools-23.0.1 android-23 . Please check your internet connection and try again.)
DownloadManager Information: 0 : Product Android SDK Setup (API Level 23) done install completed
DownloadManager Information: 0 : Increasing current install to 3
DownloadManager Information: 0 : Using execute progress heuristic for: Android SDK Setup (API Level 19 and 21)
DownloadManager Error: 0 : Install return code for product 'Android SDK Setup (API Level 19 and 21)' is Failure (The following package(s) were not downloaded: platform-tools extra-android-support extra-android-m2repository build-tools-19.1.0 build-tools-21.1.2 android-19 android-21 sys-img-armeabi-v7a-android-19 sys-img-x86-android-19 addon-google_apis-google-19 . Please check your internet connection and try again.)
DownloadManager Information: 0 : Product Android SDK Setup (API Level 19 and 21) done install completed

It turns out the root cause of this issue is that the Android SDK Package Manager doesn’t look to the machine-wide proxy settings when accessing the internet.  The Android SDK Package Manager stores it’s own proxy configuration instead.  Visual Studio is able to install the package manager, but the package manager can’t install any of the API levels because it doesn’t have the proxy information to access the internet through the secure firewall.

As it turns out there’s an easy fix for this issue!  We just need to help the Android SDK Package Manager with the proxy settings!  The package manager stores it’s proxy settings in a specific file in the user profile so we can put this file with the correct settings before installing Visual Studio and everything should work. 

Here are the steps to fix this issue!

  1. BEFORE installing Visual Studio, create a file at this location:  %USERPROFILE%\.android\androidtool.cfg
  2. In the androidtool.cfg file that you just created, place the following contents.  Make sure to update “http.proxyPort” and “http.proxyHost” in the file!
### Settings for Android Tool
#Fri Jan 08 02:53:27 UTC 2016
http.proxyPort=8888
sdkman.enable.previews=false
http.proxyHost=127.0.0.1
sdkman.ask.adb.restart=false
sdkman.show.update.only=true
sdkman.force.http=false
sdkman.use.dl.cache=true
  1. Install Visual Studio normally

Anyway, I hope that’s useful!  Post a comment below if this helped!

Subscribe to Posts

Peter Hauge

Contact me!
Email: pete @ hauge.cloud
Software Engineer at Microsoft

Recent Posts

  • Using the Azure Metadata Service for Virtual Machines
  • Authoring Azure ARM Templates
  • Recover Azure Queue Messages From the Poison Queue (unpoison messages!)
  • Creating and Deleting VSTS Team Projects with Powershell
  • How to easily switch versions of Azure PowerShell

Archives

Categories

  • ARM
  • Azure
  • Code
  • DevTest Labs
  • Powershell
  • Soft Skills
  • Troubleshooting
  • Uncategorized
  • Visual Studio
  • VSCode
  • VSTS
©2025 A Software Engineer's Logbook | Design: Newspaperly WordPress Theme