So I just installed Android Studio again after a long time and it asked me to configure the proxy, so I did. I tested the connection and it worked.
Then it asked me
Check and review all of these files for having proxy settings:
YOUR_PROJECT_ROOT/App/gradle.properties
~/.gradle/gradle.properties
~/.AndroidStudioX.Y/config/options/proxy.settings.xml
note: replaceX.Y
with your current android studio version.
I find when I change the option of Preferences -> Appearance & Behavior -> System Settings -> HTTP Proxy to Manual proxy configuration, the gradle properties of the project won't change, so I add:
systemProp.http.proxyHost= myProxyHost
systemProp.http.proxyPort= myProxyPort
Then it runs well.
Amending the gradle.properties file did not work for me. What worked was manually setting the proxy in settings. Additionally I also had to enter my user name and password on for the network.
Wish I hadn't seen this post days ago. Would have saved me time and frustration. Glad though that i persevere and found solution on my own. Mades the frustration more palatable.
Go to Preferences > Appearance & Behavior > System Settings > HTTP Proxy
If your network needs a proxy, setup Manual proxy configuration.
Else, select Auto-detect proxy settings
In your gradle.properties file inside your app project, add the following properties (both HTTP and HTTPS):
systemProp.http.proxyHost=<proxyHost>
systemProp.http.proxyPort=<proxyPort>
systemProp.https.proxyHost=<proxyHost>
systemProp.https.proxyPort=<proxyPort>
If your network has a proxy (not defined in your system configuration), go to:
File > Settings > Appearance & Behavior > System Settings > HTTP Proxy
and setup Manual proxy configuration,
otherwise, check Auto-detect proxy settings.