You may need to adjust the proxy settings in Gradle

Gradle logo

To adjust the proxy settings in Gradle, you will need to edit the file, which should be located in the .gradle directory in your home directory. This file allows you to specify various settings for Gradle, including the proxy settings.

To set the proxy settings, you can add the following lines to the file to the location Preferences > Settings > Appearance & Behavior > System Settings > HTTP Proxy Enable following option Auto-detect proxy settings:

apply plugin: ''

android {

    defaultConfig {

If you are using an http proxy server, revise the following proxy settings in “” file in your project’s root folder. If not using proxy server, just delete those entries.



Update your project level build.gradle to latest version – it works for some people.

classpath ''
classpath ''

Make sure to replace with the hostname of your proxy server, and 8080 with the port number of your proxy server. Also, replace username and password with your proxy login credentials. The nonProxyHosts property allows you to specify a list of hosts that should be accessed directly, rather than through the proxy.

After making these changes, save the file and then try running Gradle again. The proxy settings should now be in effect.

If you are using a version of Gradle that is earlier than 3.5, you can also specify the proxy settings using the -D command-line option. For example:

gradle -Dhttp.proxyPort=8080 -Dhttp.proxyUser=username -Dhttp.proxyPassword=password -Dhttp.nonProxyHosts=localhost|* build

Hope it works. we took the reference of Most of the information.

Leave a Comment