9

I am trying to install the Android SDK, in Ubuntu, behind my work firewall and am getting 'failed to connect to dl-ssl.google.com' messages. This is a known problem but every solution I see involves proxy settings and selecting the 'force http' option. It appears that this is straightforward in windows, however I'd like to know how to do the same in LINUX. I can set the eclipse proxy settings but I don't think this gets used by the android sdk manager. Is there a config file somewhere?

Thanks in advance.

Marc

Dirk Jäckel
  • 2,979
  • 3
  • 29
  • 47
user1400716
  • 1,126
  • 5
  • 13
  • 32

5 Answers5

38

The solution was to setup a local proxy to perform authentication and create the file ~/.android/androidtool.cfg to redirect android to the local proxy as follows.

### Settings for Android Tool
#Tue Jun 12 01:34:55 PDT 2012
http.proxyPort=3128
sdkman.monitor.density=108
http.proxyHost=127.0.0.1
sdkman.show.update.only=true
sdkman.ask.adb.restart=false
sdkman.force.http=true
sdkman.show.updateonly=true

This file may already exist with entries such as

http.proxyPort=
http.proxyHost=127.0.0.1\:3128

For me, this did not work until I changed it to the form shown above:

http.proxyPort=3128
http.proxyHost=127.0.0.1
Community
  • 1
  • 1
user1400716
  • 1,126
  • 5
  • 13
  • 32
  • This fixed it for me - the proxy port was the issue. – Shirkrin Aug 24 '12 at 09:35
  • My proxy requires authentication as well, but just supplying `http.proxyPort` and `http.proxyHost` did the trick; the Android tooling asked for credentials to get through that proxy. – mthmulders Jan 24 '14 at 08:55
6

Just to help someone out there.

I was able to use SDK Manager with Proxy settings with following procedure

  1. Goto Shell (Ctrl+Alt+T for ubuntu)
  2. Run "android" from the sdk\tools directory. (example /mySDKDir/tools/android)
  3. This would launch the SDK Manager. On the Main menu, goto Tools -> Options to setup the proxy settings.
  4. Select the relevant packages and download/install. SDK Manager would use the proxy settings specified.

Regards

Ali Habiby
  • 69
  • 1
  • 7
2

If you run this command:

export HTTP_PROXY=http://my_proxy:port/

in a shell before running android or eclipse, the SDK tools should honour that.

If you want it to take effect permanently account-wide, add the above line to ~/.bashrc.

Michael Slade
  • 13,802
  • 2
  • 39
  • 44
  • 2
    it doesn't. Environment: debian, android sdk build date 2013.10.30, x64. – holgac Dec 18 '13 at 11:32
  • 1
    I can confirm that, for me, using `HTTP_PROXY` (all caps) rather than `http_proxy` _did_ work. But it's 'weird', I needed to `export HTTP_PROXY=http://:@myproxy.com:8080/`, `export HTTPS_PROXY=http://:@myproxy.com:8080/`, and run this command _once_ `sdkmanager --proxy=http --proxy_host=myproxy.com --proxy_port=8080 --list`. After doing this, I didn't need the env vars any longer, nor any of the proxy options to to `sdkmanager`. (I can only assume that the proxy settings got cached somewhere[?]) – evadeflow Aug 08 '17 at 18:43
1

I was able to edit the ~/.android/androidtool.cfg with my actual proxy information, save the fact that I had to use the IP Address of my Proxy (Worked), rather than it's hostname (Did Not Work). Seems the Android SDK Management in Linux is unable to resolve names.

1

I copied the settings of android androidtool.cfg Windows to Linux file and it worked perfectly