Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Received status code 407 from server: Proxy Authentication Required

After Updating Android Studio and Gradle i get below error.

enter image description here

What i have tried:
1. I'm using a proxy and have tried automatic and manual proxy settings. check connection works and is successful, android sdk updates also shows but libraries and repositories not downloaded from google(), jcenter(), etc.
2. run as admin doesn't fix the problem. 3. the same proxy was working correctly before, i also tried other proxies which didn't work.
4. i am using windows 10, gradle 4.4, android studio 3.1.
5. reverting back to version 3.0 didn't fix the problem.
6. reverting back to gradle 4.1 didn't fix the problem.
7. clean project, invalidate cache + restart doesn't work.

Update: the problem comes from the version 3.1 and upward, it seems there was some sort of change from version 3.1 in android studio with proxy authentication. i still can't fix it.

enter image description here

enter image description here

like image 782
Masoud Mohammadi Avatar asked Mar 28 '18 14:03

Masoud Mohammadi


People also ask

How do I fix 407 proxy authentication required?

First, you'll want to make sure that you're entering the correct URL. This may sound silly, but a minor typo can lead to the HTTP 407 error. Therefore, you'll want to double-check the URL, clear your cache, and try revisiting the website.

Could not get received status code 407 from server authentication required?

The HTTP 407 Proxy Authentication Required client error status response code indicates that the request has not been applied because it lacks valid authentication credentials for a proxy server that is between the browser and the server that can access the requested resource.

What is proxy authentication required mean?

Jul 15, 2022. 1 min. http status codes. A 407 Proxy Authentication Required error indicates that the client needs to authenticate with a proxy server in order to access the requested resource. This is usually caused by incorrect proxy settings or by a firewall blocking access to the proxy server.


4 Answers

I'm using this two lines and works fine for me.

systemProp.http.proxyHost=HostIP
systemProp.http.proxyPort=portNumber

If you need to use authentication add these two more lines:

systemProp.http.proxyUser=user
systemProp.http.proxyPassword=password

I never had to use https settings.

Be sure that Http proxy which you are using is able to bypass Https protocol. I suggest using sites like free-proxy-list.net, hidemy.name/en/proxy-list which even provide proxy servers without authentication.

But first test the proxy in browser.

IF you really need to use the proxy server which you have (Being behind a firewall or something). The alternative way of binding proxy is to use softwares like Proxifier Alternatives. This app can force all connection through proxy Rules Screenshot.

like image 52
M at Avatar answered Oct 16 '22 22:10

M at


To solve this problem I'm using this code lines :

systemProp.http.proxyHost=yourProxyHost
systemProp.http.proxyPort=yourPort
systemProp.http.proxyUser=yourUser
systemProp.http.proxyPassword=yourPass

systemProp.https.proxyHost=yourProxyHost
systemProp.https.proxyPort=yourPort
systemProp.https.proxyUser=yourUser
systemProp.https.proxyPassword=yourPass

and then restart Android Studio.

like image 45
Hassan Naghibi Avatar answered Oct 16 '22 21:10

Hassan Naghibi


Go to C:\Users\windows user\.gradle which is mostly default in most of the systems. Open Gradle.properties file (You can Use Visual Studio Code editor ). Just view the proxy setting and modify them if required.

For me password was blank, I filled the password field and Gradle worked perfectly.

The above thing works only if u enabled proxy in Android studio.

like image 8
Sarath Chandra Avatar answered Oct 16 '22 22:10

Sarath Chandra


I managed to fix it this way:

  1. Android Studio (my version 3.1.2)->Settings->Http proxy->Manual proxy configuration (!!!)->Enter login and password->Check connection
  2. Possible restart Android Studio, I don't remember
  3. When gradle build was started then window with proxy settings with HTTP and HTTPs(!) for gradle was opened-->Apply settings
  4. After that file "gradle.properties (Global properties)" was automatically created, inside you must enter a password:

    systemProp.http.proxyPort=8080 systemProp.http.proxyUser=domain/login systemProp.http.proxyPassword= systemProp.https.proxyPassword= systemProp.https.proxyHost=proxy_host #systemProp.http.nonProxyHosts= systemProp.http.proxyHost=proxy_host systemProp.https.proxyPort=8080 #systemProp.https.nonProxyHosts= systemProp.https.proxyUser=domain/login

like image 1
albert Avatar answered Oct 16 '22 21:10

albert