When working in company, sometime you cannot download files directly from the internet unless you use a proxy. This is sometime annoying especially for developers, because lots of time, our tool have dependencies which have to be downloaded from somewhere in the internet.

I have encountered this problem when I tried to develop mobile app using flutter. When building Android app, it will use gradle as a build tool. But it was blocked because of the internet access.

I did some search and found out the way to setup proxy in gradle is to gradle.property file using the following keys:

  • systemProp.http.proxyHost
  • systemProp.http.proxyPort
  • systemProp.https.proxyHost
  • systemProp.https.proxyPort

proxy-in-gradle