

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to Speed up Gradle build process in Android Studio?
Before getting info speed up gradle build, we should know that, what is gradle build.Before eclipse, we dont have any automation scripts to build java and XML code to android apk. So that we used commands to generate apk. To optimize this process, gradle build come into the picture. Gradle is automated script to build and generate apk using android studio.
What is Gradle sync ?
Gradle sync is automation process to download dependencies which are declare in gradle file. A simple example as shown below −

How to speed Gradle Build in android?
Step 1 − Open gradle.properties and add the following code as shown below
# Project-wide Gradle settings. # IDE (e.g. Android Studio) users: # Gradle settings configured through the IDE *will override* # any settings specified in this file. # For more details on how to configure your build environment visit # http://www.gradle.org/docs/current/userguide/build_environment.html # Specifies the JVM arguments used for the daemon process. # The setting is particularly useful for tweaking memory settings. org.gradle.daemon = true org.gradle.parallel = true org.gradle.configureondemand = true org.gradle.jvmargs=-Djava.awt.headless = true -Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 # When configured, Gradle will run in incubating parallel mode. # This option should only be used with decoupled projects. More details, visit # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects # org.gradle.parallel=true
The above code going to increase build JVM MaxPermSize(gives 2GB max memory to JVM complier) and execute in parallel.
Step 2 − Now use the following process to speed up gradle.
Now open File → Setting →Build,Excution,Deployment → Gradle and check offline work as shown below −

Because every gradle going to sync with internet resources. So when you click on offline work, it will sync with offline resources as well.
Step 3 − Now use the following process to speed up gradle.
Now open File → Setting →Build,Excution,Deployment → complier and check all check boxs as shown below −

- Related Questions & Answers
- Ways To Speed Up Your Android Phone
- How to speed up SELECT DISTINCT in MySQL
- How to speed up $group phase in aggregation?
- How to get programmatically android build id?
- How to add picasso library in android studio?
- How to use facebook SDK in Android studio?
- How to pick up and hung up calls in android?
- How can we speed up Python "in" operator?
- How do add dependency in Android studio
- How to use OpenSSH Multiplexer To Speed Up OpenSSH Connections on Linux
- Speed up a slow pc without spending money
- How do successful people build up their image at work?
- How to speed up scrolling responsiveness when displaying lots of text in Tkinter?
- Voltage Build-Up in a Self-Excited DC Generator
- How to use action up event in android?