You can try the solution at this link:
https://www.timroes.de/2013/09/12/speed-up-gradle/
It worked for me, so it’s worth a try.
Another solution: In the settings of Android Studio> Compiler> Gradle> check the box "Compile independent modules in parallel" and place some parameters of the virtual machine.
source
share