1. Create the Gradle.properties file in the following directory
/home/<username>/.gradle/(Linux)/users/<username>/.gradle/(MAC) C:\users\<username>\.gradle ( Windows)
Add in Folder
# project-wide Gradle settings.# IDE (e.g. Android Studio) users:# settings specified in this file would override any Gradl E settings# configured through the ide.# for more details about how to configure your build environment visit# Http://www.gra dle.org/docs/current/userguide/build_environment.html# The Gradle daemon aims to improve the startup and execution time of gradle.# when set to True the Gradle daemon are to run the build.# todo:disable daemon in CI, since builds should be Clea N and reliable on serversorg.gradle.daemon=true# specifies the JVM arguments used for the daemon process.# the setting is Particularly useful for tweaking memory settings.# Default value:-xmx10248m-xx:maxpermsize=256morg.gradle.jvmargs=- xmx2048m-xx:maxpermsize=512m-xx:+heapdumponoutofmemoryerror-dfile.encoding=utf-8# when configured, Gradle'll run In incubating parallel mode.# This option is should only being used with decoupled projects. More details, visit# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projectsorg.gradle.parallel=true# enables new incubating mode that makes Gradle Selective when configuring projects.# only relevant projects is configured which results in faster builds for large multi -projects.# Http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:configuration_on_ Demandorg.gradle.configureondemand=true
The purpose of the above configuration: increase the size of Gradle running Java Virtual machine, let gradle at compile time use independent process, let Gradle can run parallel.
2. Configuring in Android Studio
Turn on offline mode
Improve the build speed practice of Android Studio