I recently upgraded my Android Studio from 3.0 to 3.1. In 3.0, I used to set proxy configuration in <em>gradle.properties</em>(Global properties) file, which includes setting <em>systemProp.https.proxyPassword</em> 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 <em>gradle.properties</em> (with global scope), I am unable to do git pull/push operations. It returns the following error:<blockquote>
Update canceled<br /> Fetch failed: unable to access '<a href="https://github.com/user_name/repo_name.git/" rel="nofollow">https://github.com/user_name/repo_name.git/</a>': Received HTTP code 407 from proxy after CONNECT</blockquote> Answer1:
One solution which worked for me is the following.<ol><li><strong>Uncheck</strong> 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).</li> </ol>
<a href="https://i.stack.imgur.com/5HknY.png" rel="nofollow"><img alt="Pop up window where you have to uncheck the proxy authentication" class="b-lazy" data-src="https://i.stack.imgur.com/5HknY.png" data-original="https://i.stack.imgur.com/5HknY.png" src="https://etrip.eimg.top/images/2019/05/07/timg.gif" /></a><ol start="2"><li>
I set the following in gradle.properties (replace <em>xxxx</em> 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</li> <li>
Go to File -> Settings -> Appearance & Behavior -> System Settings -> HTTP Proxy. Enter your proxy details (with username and password here)</li> </ol>