21

I was using proxy on my system for some purpose. But now I don't have any proxy set on my system as well as from the Android Studio proxy settings I have removed the proxy and set it to no proxy.

But I keep getting the following error:

You have JVM property "https.proxyHost" set to .... This may lead to incorrect behavior. Proxy should be set in Settings|HTTP Proxy

As well when I try to build/sync the Gradle file without proxy server the files doesn't get compiled and says please check your network connection where I have internet connection.

user207421
  • 305,947
  • 44
  • 307
  • 483
silverFoxA
  • 4,549
  • 7
  • 33
  • 73

7 Answers7

29

If anyone still looking for the solution to the same, here is what worked for me

JAVA_OPTS="$JAVA_OPTS -DsocksProxyPort"

for removing http proxy ports

Source http://mxw.pl/blog/?p=4

Thomas Keller
  • 5,933
  • 6
  • 48
  • 80
silverFoxA
  • 4,549
  • 7
  • 33
  • 73
18

select Help -> Edit Custom VM Options add below:

-Dhttp.proxyHost
-Dhttp.proxyPort
-Dhttps.proxyHost
-Dhttps.proxyPort
-DsocksProxyHost
-DsocksProxyPort
daroubaozi
  • 264
  • 2
  • 5
13

Using a Mac:

Go to Network settings -> Advanced -> Proxies and uncheck "proxy server required password" for both HTTP and HTTPS. Remove user name and password.

In IntellJ/Android Studio restart with File -> Invalidate and Restart -> Just Restart

Patrick
  • 33,984
  • 10
  • 106
  • 126
6

on Mac: goto System Preferences, Java -> open java control pan -> general -> Network Settings -> choose 'Direct Connection' enter image description here

paperhs
  • 194
  • 2
  • 6
2

This is caused by switching agents on and off many times. Under Mac: Open the 〜/.gradle/gradle.properties file and delete the agent configuration manually.

  • I had a [proxy issue](https://stackoverflow.com/questions/36330895/gradle-sync-failed-connection-refused) with a fresh install of Android Studio, but this solved it. – Barnyard Oct 20 '21 at 16:43
1

I solved this problem by this solution:

On Windows:

Go to your User Folder - on Windows 7/8 this would be:

[SYSDRIVE]:\Users\[your username] (ex. C:\Users\Iman\)

In this folder there should be a folder called .AndroidStudioBeta or .AndroidStudio (notice the period at the start - so on some OSes it would be hidden).

Delete this folder (or better yet, move it to a backup location - so you can return it if something goes wrong).

This should reset your Android Studio settings to default.

Iman Marashi
  • 5,593
  • 38
  • 51
0

On Mac , Go to System Settings -> Network -> Proxies

enter image description here

Make sure all these (HTTP,HTTPS,SOCKS) are cleared & Off, Set proxy in your IntellIJ

resatz
  • 536
  • 3
  • 8