Setting up Http Proxy in Android Studio

I read several similar questions and documentation, but I was not able to solve my problem with the corporate firewall my machine is sitting on. The error I am getting is “Failed to update Gradle project” Unknown services.gradle.org node. Everything that I read and understood makes me believe that this is a proxy server problem. I tried setting the proxy properties in the gradle.properties file in the Project folder, so my gradle.properties file looks like this:

# Project-wide Gradle settings.

# IDE (e.g. Android Studio) users:
# Settings specified in this file will override any Gradle settings
# configured through the IDE.

# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html

# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
# Default value: -Xmx10248m -XX:MaxPermSize=256m
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -    Dfile.encoding=UTF-8

# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
#  http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true

systemProp.http.proxyHost=proxy.company.com
systemProp.http.proxyPort=83
systemProp.http.proxyUser=username
systemProp.http.proxyPassword=password
systemProp.http.auth.ntlm.domain=domain

systemProp.https.proxyHost=proxy.company.com
systemProp.https.proxyPort=83
systemProp.https.proxyUser=username
systemProp.https.proxyPassword=password
systemProp.https.auth.ntlm.domain=domain

I also tried setting global Gradle settings by choosing File-> Settings → Gradle and setting Gradle VM parameters using:

-Dhttp.proxyHost=proxy.company.com -Dhttp.proxyPort=83 -Dhttp.proxyUser=username -Dhttp.proxyPassword=password

I don't see any documentation on where else to set this http proxy option, please help if you can.

+4
4

gradle

-Dhttp.proxyHost=proxy.company.com -Dhttp.proxyPort=83 -Dhttp.proxyUser=username -Dhttp.proxyPassword=password -Dhttp.auth.ntlm.domain=domain

.

+3

, . SDK . "proxycap" ( ). ! proxy freewares (proxify...), - , - Android.

+1

I do not know if there was a proxy option in the previous version, but in v1.0.1 and higher you can find it in the settings File-> Settings → IDE.

0
source
//gradle.properties

systemProp.http.proxyHost=www.somehost.org

systemProp.http.proxyPort=8080

systemProp.http.proxyUser=userid

systemProp.http.proxyPassword=password

systemProp.http.nonProxyHosts=*.nonproxyrepos.com|localhost
0
source

Source: https://habr.com/ru/post/1546353/


All Articles