Android Studio Gradle Fabric with proxy settings “

2019-04-27 04:20发布

问题:

I have an Android project that uses the Crashlytics with Fabric plugin on the Android Studio , set up the proxy for the files :

studio64.exe.vmoptions :

-Dhttps.proxyPort=8080
-Dhttps.proxyHost=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
-Dhttps.proxyUser=xxxxx
-Dhttps.proxyPassword=xxxxxxxx

gradle.properties:

systemProp.http.proxyPassword=xxxxx
systemProp.http.proxyHost=proxy-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
systemProp.http.proxyUser=xxxxxxxx
systemProp.http.proxyPort=8080

systemProp.https.proxyPassword=xxxxx
systemProp.https.proxyHost=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
systemProp.https.proxyUser=xxxxxxxx
systemProp.https.proxyPort=8080

For some reason I can not log into the plug giving the message "Unable to connect to the network"

Anyone have any ideas or possible solution to this problem ?

回答1:

Navigate to

Android Studio directory > bin

Add below lines to studio.exe.vmoptions and studio64.exe.vmoptions

-Dhttps.proxyHost=PROXY_ADDRESS
-Dhttps.proxyPort=PROXY_PORT
-Dhttps.proxyUser=USER_NAME_HERE
-Dhttps.proxyPassword=PASSWORD_HERE

It is working perfectly fine with Android studio 2 Beta 5 for me .

UPDATED:

If you have any special characters in your username or password like "Domain/Userid" make sure you replace you your special characters with ASCII Encoding Reference here https://www.w3schools.com/tags/ref_urlencode.asp