I
I
illuzor2015-08-28 20:08:06
Android
illuzor, 2015-08-28 20:08:06

How to beat gradle brakes in Android Studio?

Greetings.
Android Studio is terribly slow when running gradle. Slightly hangs the interface of the operating system and lags the music played in the background. Now on Windows 10 x64, before that there were Windows 8 / 8.1 x64 and the same thing was observed. With IDEA the same brakes. The laptop is quite powerful (Intel i7 x940 2.13 GHz, 8GB DDR3 RAM, SSD).
At the same time, on a stationary PC, which is noticeably weaker, there are no such brakes.
I suspect that it is not in the gland, but I can not figure it out.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
O
Oleg Gamega, 2015-08-28
@gadfi

create a gradle.properties file in
/home/[username]/.gradle/ (Linux)
/Users/[username]/.gradle/ (Mac)
C:\Users\[username]\.gradle (Windows)
and write in it

# 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
org.gradle.jvmargs=-Xmx512m -XX:MaxPermSize=512m -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

it helped me

T
Tiberal, 2015-08-31
@Tiberal

if there are a lot of builds in the application, then you can run only what you need for assembly, the build speed will increase and the system will load less

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question