Search code examples
androidandroid-studiogradleandroid-gradle-pluginhttp-proxy

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 (e.g. 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?


Solution

  • 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.