How to set up proxy in Android Studio?

Asked

Viewed 5,827 times

6

Company where I work adhered to the use of proxy and I’m having problems using the gradle.

Gradle returns the following error :

Error:Connection timed out: connect. If you are Behind an HTTP proxy, Please configure the proxy Settings either in IDE or Gradle.

Has anyone ever needed to perform this configuration?

2 answers

8


I was able to perform the configuration of proxy through the following steps:

In Android Studio navigate to :

File > Settings > System Settings > HTTP Proxy 

Inside this menu check the option Manual proxy configuration and select HTTP

Host name : "url of your proxy"

Port number: "port of your proxy"

If your proxy has user and password you must add in the appropriate fields Login and password.

After following these steps of OK and run the build on again gradle.

1

I have a detail to add.

In some cases you will also need to configure HTTPS

After setting through the FILE>SETTINGS>HTTP PROXY menu, in the first synchronization will open (if you set the manual proxy) a window with the settings of the proxy set (only in the first synchronization). Also check the HTTPS option, since such option was not available in the first configuration.

If the problem persists select the NO PROXY option, apply the changes, and try to redo the MANUAL PROXY configuration, remembering to check the HTTPS option on the first run.

I hope it’s useful. Att., Daniel., Daniel.

  • Good catch, I didn’t even think about it then.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.