Flutter - Slow gradle build

930

According to this documentation by developer.android.com there is a way to optimize gradle build by using JVM Garbage collector. Add this parameter to your gradle.properties in your android folder you can find it on /{your-project}/android/:

org.gradle.jvmargs=-XX:+UseParallelGC

and if there are already value set in this field, just add a new option:

org.gradle.jvmargs=-Xmx1536m -XX:+UseParallelGC
Share:
930
ishon19
Author by

ishon19

Updated on December 22, 2022

Comments

  • ishon19
    ishon19 over 1 year

    I have recently started Flutter development and on my machine, and the gradle build seemingly takes forever when completely restarting the app or running it for the first time, at times it gets quite frustrating. I am using an Ubuntu 20.04 (KDE Plasma env) with 8 GB RAM/ 240 GB SSD and using VS Code for running the app. Is there any way to optimize this? Would appreciate any suggestion on the same. Thanks in advance.