Is there any way to simply set up a global, system-wide proxy for gradle?
Yes, I know there is a systemProp.http.proxyHost
, ...etc settings in the current gradle.properties
file, but it works only in the actual project. But
So, is there any "global gradle.properties" file or so?
Android plugin for Gradle HTTP proxy settings gradle file as required for each application module. For project-wide HTTP proxy settings, set the proxy settings in the gradle/gradle. properties file.
On your android studio goto file -- settings -- Build, Execution, Deployment --Build Tools -- Gradle and choose Use local gradle distribution, in the gradle home locate your gradle folder and click apply. Then click okay. This solved the problem for me.
Yes it seems possible. See here, especially:
We can define a
gradle.properties
file and set the property in this file. We can place the file in our project directory or in the<USER_HOME>/.gradle
directory. The properties defined in the property file in our home directory take precedence over the properties defined in the file in our project directory. As a bonus we can also define system properties in a gradle.properties file, we only have to prefix the property name withsystemProp
..
The gradle.properties files can be found at the following paths:
# windows gradle file %userprofile%\.gradle\gradle.properties # linux gradle file ~/.gradle/gradle.properties
Copy & paste:
systemProp.http.proxyHost=127.0.0.1 systemProp.http.proxyPort=8080 systemProp.https.proxyHost=127.0.0.1 systemProp.https.proxyPort=8080
to gradle global config
= current user's gradle.properties
$HOME/.gradle/gradle.properties
/Users/limao/.gradle/gradle.properties
%userprofile%\.gradle\gradle.properties
More details refer official doc Accessing the web through a HTTP proxy
Thanks to @Opal's answer, @fty4
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With