I have a multi-module (>20) project in Android Studio. The problem which I am facing is that whenever there in some change in build.gradle file of any module or if a new module is added, Android Studio asks for gradle sync which takes insanely high time (~12-15 minutes) and memory (order of 5GB). I want to know why what is causing this? Is there a way to find out what happens during gradle sync? Is there a terminal command to run gradle sync? Please help!
I have been trying to figure out what actually happens during a gradle sync and how one can improve gradle sync timings. I am summarizing what I have found in this answer.
-Xms512m
-Xmx4g
-XX:MaxPermSize=2g
-XX:ReservedCodeCacheSize=512m
-XX:+UseCompressedOops
I hope this is useful!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With