Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error:Unknown host services.gradle.org. You may need to adjust the proxy settings in Gradle

Tags:

i have tried it many times but its giving me same error.how to set the proxy so that this error is solved

like image 727
avez raj Avatar asked Nov 12 '15 05:11

avez raj


People also ask

How do you fix unknown host services gradle org You may need to adjust the proxy settings in gradle?

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.

How to adjust the proxy settings in gradle android studio?

To set the HTTP proxy settings in Android Studio: From the menu bar, click File > Settings (on macOS, click Android Studio > Preferences). In the left pane, click Appearance & Behavior > System Settings > HTTP Proxy.


2 Answers

Go to..

File > Settings > Appearance & Behavior > System Settings > HTTP Proxy Enable following option Auto-detect proxy settings

and press checkConnection button for test

like image 60
vahid karimi Avatar answered Oct 14 '22 15:10

vahid karimi


In my case issue occurred after following:

I selected proxy settings from Android Studio settings when I was working in a network behind a proxy. When I disconnected from that network and connected to home network which doesn't have a proxy, I removed the proxy settings from Android Studio, but gradle seemed to take the old proxy settings.

The problem was that gradle had also saved the proxy settings in following file when I set proxy settings in Android Studio, but it hasn't got removed when I removed proxy settings from Android Studio.

%HOME%\.gradle\gradle.properties

When I removed the proxy settings from this file, gradle sync worked again.

like image 45
Lahiru Chandima Avatar answered Oct 14 '22 16:10

Lahiru Chandima