The very first thing, that I’m doing after project import into Android Studio, is the switch from
Gradle wrapper to
local Gradle distribution. That have two benefits:
- All projects can use same Gradle daemon.
When you switch project A to project B and they have different gradle wrapper versions, Android Studio has to start different daemons. This can happen when you switch between different branches on the same project. Less daemons started in same time — less pressure on the system.
- Bump Gradle version independently from the project.
It takes time until new version propagates everywhere. All projects, all branches. Some teams are very fast in that, some are more conservative. With local distribution you can bump Gradle the same day stable version is released or even use release candidate version. One command and new version is applied to all your projects.
How to install Gradle
brew install gradle
On Windows: download, unpack and install
How to configure Android Studio
Preferences -> Build, Execution, Deployment -> Gradle. Select
Use local gradle distribution and specify
/usr/local/opt/gradle/libexec in case you installed it via
For Windows: specify the path where you installed Gradle.
How to use from terminal
gradle instead of
./gradlew. For example:
How to see how many daemons are running