Home > OS >  Can I successfully access overseas networks after opening a VPN proxy, but why does gradle still fai
Can I successfully access overseas networks after opening a VPN proxy, but why does gradle still fai

Time:11-09

Since I cannot access the overseas Internet locally, I opened a vpn, and then I can access overseas websites normally, but why Android studio still cannot download the corresponding gradle resources, causing the compilation to fail? I have even opened a global proxy. Doesn't it take effect for the software, but only for web browsing?

CodePudding user response:

You have to know what port your vpn is working on .

for example , if you downloaded psiphone , you can go to settings , then local proxy ports and you can add 12345 as port for example .

then you need to go to .gradle folder , if your using windows its usually located at USER/%USERNAME%/.gradle , and create a global gradle.properties and then add the following .

systemProp.http.proxyHost=127.0.0.1
systemProp.http.proxyPort=12345
systemProp.https.proxyHost=127.0.0.1
systemProp.https.proxyPort=12345

This will redirect all gradle connection throw your proxy , in the case psiphone for example.

  • Related