Gradle distributionUrl: bin vs all
October 12, 2019
Whenever you create a project in Android Studio, a gradle-wrapper.properties
file is created in the folder gradle/wrapper
.
It holds different information about the Gradle configuration of your project.
Your distributionUrl
should be targeting a URL with a suffix -all.zip
. It’s bigger than what you need.
By default, it holds the Gradle binaries as well as the samples and docs. In the current version (3.6.2), it’s 133.16 MB.
When you don’t look into the docs or samples within your IDE, you can avoid downloading them by getting only the binaries (89.54MB). To do so, replace the -all.zip
suffix by -bin.zip
.
Your final gradle-wrapper.properties should look like that:
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-bin.zip
Android Studio notifies you whenever a new version is available, and if you’re curious, you can check the changelog here.
Any thoughts or comments? Ping me on Twitter @yrezgui