Android Studio instantly builds a slow complete build

When Instant Runturned on, the full build will take up 100% of my processor. MacBook is lagging and almost not applicable.

Build time:

Command line: 
Total time: 1 mins 35.025 secs

Android Studio:
Total time: 4 mins 23.928 secs

If instant start is disabled, I get the same time as on the command line. When profiling a complete assembly, I notice that it app:transformClassesWithDexForDebugtakes up to 3 minutes.

Is there a way to improve performance on a clean build with instant start enabled?

Macbook 10.11.5 / Core i7
Android Studio 2.1.1
Gradle tools 2.1.0

gradle.properties

org.gradle.daemon=true
org.gradle.parallel=true
org.gradle.jvmargs=-Xmx5120M
+4
source share
3 answers

you can try to install

minSdkVersion = 21

build.gradle, .

:

0

- Instant Run :

→ , , → .

0

, DEX

android {
  ...
  dexOptions {
    maxProcessCount 4 // this is the default value
    javaMaxHeapSize "2g"
  }
}

minSdkVersion 15 , - .

.

- 5-6 , ...

, .

0
source

All Articles