Pranav
Pranav

Reputation: 475

Android Studio 3.1: Proxy configuration: Unable to set https user password for git operations

I recently upgraded my Android Studio from 3.0 to 3.1. In 3.0, I used to set proxy configuration in gradle.properties(Global properties) file, which includes setting systemProp.https.proxyPassword among others. However, I am unable to set this variable in 3.1. It seems like a design decision to prevent writing user password in an user-accessible file. However, how to go about setting the same?

Currently, whenever I set systemProp.https.proxyPassword, it gets overwritten with blank field next time I open Android Studio. And even after setting this variable again in gradle.properties (with global scope), I am unable to do git pull/push operations. It returns the following error:

Update canceled
Fetch failed: unable to access 'https://github.com/user_name/repo_name.git/': Received HTTP code 407 from proxy after CONNECT

Upvotes: 4

Views: 6769

Answers (4)

kirkadev
kirkadev

Reputation: 348

In my case problem was with file etc/hosts

After adding required IP and host I got success.

Upvotes: 0

Praneeth Kumar
Praneeth Kumar

Reputation: 234

C:\Users\Admin.gradle\gradle.properties open this file in your notepad and update your password both for
systemProp.http.proxyPassword=
systemProp.https.proxyPassword=

it worked for me !!!!

Upvotes: 2

Jose Lopez
Jose Lopez

Reputation: 51

You can also write:

systemProp.https.proxyPort=xxxx
systemProp.https.proxyUser=xxxx
systemProp.https.proxyHost=xxxx
systemProp.https.proxyPassword=xxxx
systemProp.http.proxyPort=xxxx
systemProp.http.proxyUser=xxxx
systemProp.http.proxyPassword=xxxx
systemProp.http.proxyHost=xxxx

in %UserHome%/.gradle/gradle.properties Then, if Android studio ask you about proxy, just ignore it... It worked for me

Upvotes: 2

vineeshvs
vineeshvs

Reputation: 565

One solution which worked for me is the following.

  1. Uncheck the box which says 'Require authentication' in the pop-up window which comes when you click on the proxy-error message. Note that the password section is 'N/A' in this pop-up message (i.e., there is option only to enter the username. It says you need to add the password in the gradle.properties file).

Pop up window where you have to uncheck the proxy authentication

  1. I set the following in gradle.properties (replace xxxx with your details)

    systemProp.https.proxyPort=xxxx
    systemProp.https.proxyUser=xxxx
    systemProp.https.proxyHost=xxxx
    systemProp.https.proxyPassword=xxxx
    systemProp.http.proxyPort=xxxx
    systemProp.http.proxyUser=xxxx
    systemProp.http.proxyPassword=xxxx
    systemProp.http.proxyHost=xxxx
    
  2. Go to File -> Settings -> Appearance & Behavior -> System Settings -> HTTP Proxy. Enter your proxy details (with username and password here)

Upvotes: 2

Related Questions