Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <h2>Hardware</h2> <p>I'm sorry, but upgrading development station to SSD and tons of ram has probably a bigger influence than points below combined. </p> <h2>Tools versions</h2> <p>Increasing build performance has major priority for the development teams, so make sure you are using latest <a href="https://docs.gradle.org/current/release-notes" rel="noreferrer">Gradle</a> and <a href="http://tools.android.com/tech-docs/new-build-system" rel="noreferrer">Android Gradle Plugin</a>.</p> <h2>Configuration File</h2> <p>Create a file named <code>gradle.properties</code> in whatever directory applies:</p> <ul> <li><code>/home/&lt;username&gt;/.gradle/</code> (Linux)</li> <li><code>/Users/&lt;username&gt;/.gradle/</code> (Mac)</li> <li><code>C:\Users\&lt;username&gt;\.gradle</code> (Windows)</li> </ul> <p>Append:</p> <pre><code># 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. # https://medium.com/google-developers/faster-android-studio-builds-with-dex-in-process-5988ed8aa37e#.krd1mm27v org.gradle.jvmargs=-Xmx5120m -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 # Set to true or false to enable or disable the build cache. # If this parameter is not set, the build cache is disabled by default. # http://tools.android.com/tech-docs/build-cache android.enableBuildCache=true </code></pre> <p>Gradle properties works local if you place them at <code>projectRoot\gradle.properties</code> and globally if you place them at <code>user_home\.gradle\gradle.properties</code>. Properties applied if you run gradle tasks from console or directly from idea:</p> <h2>IDE Settings</h2> <p>It is possible to tweak Gradle-IntelliJ integration from the IDE settings GUI. Enabling "offline work" (check answer from <a href="https://stackoverflow.com/a/23648341/624706">yava</a> below) will disable real network requests on every "sync gradle file".</p> <p><img src="https://i.stack.imgur.com/hGnDg.png" alt="IDE settings"></p> <h2>Native multi-dex</h2> <p>One of the slowest steps of the apk build is converting java bytecode into single dex file. Enabling native multidex (minSdk 21 for debug builds only) will help the tooling to reduce an amount of work (check answer from <a href="https://stackoverflow.com/a/30070657/624706">Aksel Willgert</a> below).</p> <h2>Dependencies</h2> <p>Prefer <code>@aar</code> dependencies over library sub-projects. </p> <p>Search aar package on <a href="http://search.maven.org/" rel="noreferrer">mavenCentral</a>, <a href="https://bintray.com/bintray/jcenter" rel="noreferrer">jCenter</a> or use <a href="https://jitpack.io/" rel="noreferrer">jitpack.io</a> to build any library from github. If you are not editing sources of the dependency library you should not build it every time with your project sources. </p> <h2>Antivirus</h2> <p>Consider to exclude project and cache files from antivirus scanning. This is obviously a trade off with security (don't try this at home!). But if you switch between branches a lot, then antivirus will rescan files before allowing gradle process to use it, which slows build time (in particular AndroidStudio sync project with gradle files and indexing tasks). Measure build time and process CPU with and without antivirus enabled to see if it is related. </p> <h2>Profiling a build</h2> <p>Gradle has built-in support for <a href="https://docs.gradle.org/current/userguide/tutorial_gradle_command_line.html#sec:profiling_build" rel="noreferrer">profiling projects</a>. Different projects are using a different combination of plugins and custom scripts. Using <code>--profile</code> will help to find bottlenecks. </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload