I am trying to figure out why our Gradle build is so slow. Currently each time you hit build with no changes the build time is around 45 seconds. This is a single module project. I have turned on profiling and most of the time is spent on :app:dexDebug
. We are build using Gradle 2.8 and my dex options are as follows:
dexOptions {
preDexLibraries = false
incremental true
javaMaxHeapSize "4g"
}
From the profile report:
:app 43.957s (total)
:app:dexDebug 28.727s
Is there a way to speed this up? Why does dex have to be rebuilt each time?