9
I’m going through the hardest time using Android Studio due to the delay in the project compilation process. What settings improve performance of Android Studio + Gradle?
9
I’m going through the hardest time using Android Studio due to the delay in the project compilation process. What settings improve performance of Android Studio + Gradle?
6
There are some settings that can help to give an accelerated in the process of build
of Gradle:
Perform the following settings:
daemon
Gradle (decreases startup time of process that makes the build
). Since with the deamon
the process will not need to be initialized always (only the first time).All this through the gradle.properties
.
You can both set up in your gradle.properties
from the root of your project or globally at seu_home/.gradle/gradle.properties
.
# Project-wide Gradle settings.
# IDE (e.g. Android Studio) users:
# Settings specified in this file will override any Gradle settings
# configured through the IDE.
# For more details on how to configure your build environment visit
# http://www.gradle.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 is to run the build.
# TODO: disable daemon on CI, since builds should be clean and reliable on servers
org.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=256m
org.gradle.jvmargs=-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
# Enables new incubating mode that makes Gradle selective when configuring projects.
# Only relevant projects are configured which results in faster builds for large multi-projects.
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:configuration_on_demand
org.gradle.configureondemand=true
Or by settings by Settings of Android Studio:
Do not use the self-importance of Android Studio, there is a unsolved bug that leaves the IDE slower.
Use the mode offline
of Android Studio, ignoring dependency update checks:
Thanks, Wakim. You went straight to the point and didn’t keep stalling asking how much RAM my machine has. I’ll make these settings. Thank you.
@Wakim, it didn’t help the settings :(I think the way will be an upgrade
@Wellingtonavelino, really with the amount of libraries we use, the build becomes very heavy. Remembering that each of them needs to go through the build process along with apk to create DEX. A while ago google started a new build tool called Jack and Jill, which is still very experimental (not having many features like note processing) which tends to reduce build time. Another solution that usually helps is to always be with the latest version of Gradle (current 2.6), then just check in your Gradle-wrapper properties..
So @Wakim, I use AS every day at work I have no problems, at home I am working on an app I got this doubt, but I played more 8gb and is quiet now haha, thanks for the comment! Go Android!
@Wakim thank you very much, great reply!
Excellent response. Greatly accelerated Build.
Browser other questions tagged android-studio gradle
You are not signed in. Login or sign up in order to post.
It’s not my area of programming, but as a general rule, it’s nice to provide as much detail as possible setup, so it becomes easier to give a correct diagnosis. You can see more details in [Ask]. Good luck!
– brasofilo
How many Giga RAM are available on the computer?
– Tony