The necessary files will be copied into the project directory, and you should include them in your repository. When you create a project with Android Studio, the Gradle wrapper is included by default. If you start a project using Gradle 2.2.1 and start another project using Gradle 2.4, those projects can both be built with the Gradle version they require, even on the same machine.
Manually installing Gradle is not necessary, and you don’t need to manage several version of Gradle yourself.Īnother advantage of using the wrapper is that it enables you to use different versions of Gradle for different projects. The idea behind this is that developers and automated systems that need to build the app can do so just by downloading the repository and running the wrapper, which will take care of the rest. If the selected version of Gradle is already downloaded, it functions as a proxy to the local Gradle binary. When you run this script and the selected version of Gradle is not present, it will be downloaded automatically. The Gradle wrapper is a batch file on Windows called gradlew.bat or a shell script on Mac OS X and Linux called gradlew. Gradle is under constant development, and new versions could potentially break functionality. Using the Gradle wrapper, however, has huge advantages.
They usually installed Gradle manually, because they figured it was necessary to get their builds to work now that Google is pushing Gradle. I sometimes meet Android developers that are using Android Studio and Gradle for their projects, but have no idea what is happening when I start executing gradlew in the command line interface. Use the Gradle Wrapper for your Android projects