0

After importing Fresco (Facebook's image awesome product) library to my project, the speed of Android Studio compile project slowed down almost 1 minute. What can I do to speed up? I tried many methods that were metioned to speed up gradle compile speed but it did not work effectively.

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Walker_Lee
  • 71
  • 4
  • Sorry I find a spell mistake, Library name is Fresco! – Walker_Lee Aug 06 '15 at 08:49
  • Can you share your gradle file project and the gradle version used? – Dekra Aug 06 '15 at 08:54
  • My gradle version is 2.3,build tool version is 1.3.0.I import fresco in my Library project and compile ('com.facebook.fresco:fresco:0.6.0'){ exclude module: 'bolts-android' exclude module: 'support-v4' } – Walker_Lee Aug 06 '15 at 09:05

1 Answers1

0

Try to move to gradle 2.4. Gradle 2.4 boosts performances. For manually editing the build script, add the following at the end of your root build.grade script.

task wrapper(type: Wrapper) {
    gradleVersion = '2.4'
}

Running ./gradlew wrapper and it will download and setup Gradle version 2.4 for your local Gradle wrapper. After that, you have to enable the Gradle daemon and parallel build for your project. These settings are enable by adding a file named gradle.properties under .gradle in your home directory (i.e., ~/.gradle/gradle.properties).

org.gradle.daemon=true
org.gradle.parallel=true

You can add additional Gradle parameters here, like increasing the max heap size in case you have a large project or specifying which JVM to use:

org.gradle.jvmargs=-Xmx768m
org.gradle.java.home=/path/to/jvm

You can find more info here

Dekra
  • 554
  • 5
  • 15