简体   繁体   中英

How to set proxy settings not in project's gradle.properties?

I need to set some proxy settings for my Android Studio (v1.5.1) project (on Ubuntu). Every time I need it (eg when downloading an external library), Android Studio proposes to write them to gradle.properties , with no other option.

Since this file is version-controlled on a git repository, I need to set them somewhere else.

Any suggestion?

You can use the /home/user/.gradle/gradle.properties file.

This file is not under version control and it is used by all projects in your machine. This file is used by gradle without any setting, and you can use it to store some reserved data for example.

The configuration is applied in following order (if an option is configured in multiple locations the last one wins):

  • from gradle.properties in project build dir .
  • from gradle.properties in gradle user home .

You will need to add it to gradle.properties . You can just mark the file to be ignored by git so that you do not accidentally check in the proxy details.

OR

just momentarily switch to a public network when the proxy is blocking some network resources.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM