Android Studio gradle-###-bin.zip vs. gradle-###-all.zip

AndroidAndroid StudioAndroid Gradle-Plugin

Android Problem Overview


One developer on my team has some setting in Android Studio that replaces the distributionUrl entry in gradle/wrapper/gradle-wrapper.properties to use the gradle-###-all.zip, while my Android Studio changes it back to gradle-###-bin.zip.

Basically, my diff always looks like:

+distributionUrl=https\://services.gradle.org/distributions/gradle-1.12-bin.zip

This is annoying. What setting is it, and how do I change it?

Android Solutions


Solution 1 - Android

gradle-1.12-all.zip file will have binaries, sources, and documentation. gradle-1.12-bin.zip will have only binaries(That should be enough as you don't need any samples/docs)

If you want to know about gradle wrapper, please check this http://www.gradle.org/docs/current/userguide/gradle_wrapper.html

Solution 2 - Android

From what I've seen Android Studio recommends to use gradle-*-all.zip and even provides a "quick fix" to change that. On the other hand, the command ./gradlew wrapper sets up the wrapper using gradle-*-bin.zip, overwriting the previous setting. Make sure nobody is calling "./gradlew wrapper" automatically.

Solution 3 - Android

If you and the other developer want a uniform experience, place this code in your build.gradle file

wrapper {
    distributionType = Wrapper.DistributionType.ALL
}

This will make ./gradlew wrapper --gradle-version 5.6 automatically append -all instead of -bin

For build.gradle.kts:

tasks.wrapper {
    distributionType = Wrapper.DistributionType.ALL
}

Solution 4 - Android

The difference is that the -bin version contains only the runtime and no sample code and documentation. 1

It actually makes sense to go for the -bin version: it is smaller and you're unlikely to need the -all version unless you're debugging Gradle scripts. For this reason, the lint warning to go for the -all version has been removed. Also, new projects are generated with the -bin version by default.

There is a ticket to let IntelliJ download the sources when you need them (after which there really isn't a reason for the -all version), but it hasn't been implemented yet.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionJeff BratemanView Question on Stackoverflow
Solution 1 - AndroidSanView Answer on Stackoverflow
Solution 2 - AndroidniquecoView Answer on Stackoverflow
Solution 3 - AndroidMark HanView Answer on Stackoverflow
Solution 4 - AndroidCristanView Answer on Stackoverflow