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.

0

7 Answers 7

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

11
  • 4
    May you please elaborate, where do i need to type this line.
    – inderbagga
    Jun 29, 2016 at 17:55
  • 1
    It doesn't return but if no error that means it has been processed successfully
    – silverFoxA
    Jun 29, 2016 at 18:23
  • 1
    JAVA_OPTS="$JAVA_OPTS -DsocksProxtPort"
    – qinmiao
    Nov 16, 2017 at 3:50
  • 2
    Brother, you just saved me another gruelling hour. I want to send you flowers. Apr 23, 2018 at 9:35
  • 1
    Hello,I was checked this link mxw.pl/blog/?p=4 but doesn't work .Can you explain.How can ı apply this solution?thank you. Apr 19, 2021 at 6:20
19

select Help -> Edit Custom VM Options add below:

-Dhttp.proxyHost
-Dhttp.proxyPort
-Dhttps.proxyHost
-Dhttps.proxyPort
-DsocksProxyHost
-DsocksProxyPort
2
  • 2
    This is the best answer , because only need configure once and never need to worry this problem again
    – Garfield
    Mar 19, 2021 at 5:25
  • And restart the IDE.
    – eccstartup
    Apr 25, 2023 at 11:57
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

6

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

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.

1
  • I had a proxy issue with a fresh install of Android Studio, but this solved it.
    – Barnyard
    Oct 20, 2021 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.

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.