In July I wrote a post documenting how to build a project in Android Studio from behind a proxy. Essentially you need to tell Gradle Studio your proxy settings.
As of updating to Android Studio 1.0, the issue has come back! After a combination of swearing and research I’ve found the missing necessary steps.
So the new definitive steps for getting Gradle working from behind a proxy
- Navigate to the “.gradle” folder in your user directory (e.g. C:\Users\bob\.gradle)
- Create a “gradle.properties” file
- Edit the file to have the following contents (replacing your own values)
systemProp.http.proxyHost=<proxy_host> systemProp.http.proxyPort=<port> systemProp.http.proxyUser=<user> systemProp.http.proxyPassword=<password> systemProp.http.nonProxyHosts=*.nonproxyrepos.com|localhost
- Go to Files > Settings > HTTP Proxy
- Select “Manual proxy configuration”
- Enter the same details you filled into the grade.properties file above: host, port, etc
- Tick “Proxy authentication”
- Fill in your username and password
Tadaa. This should get you back up and running again.
Pingback: Using Gradle from behind a proxy | Seb Charrot