I am trying to understand why our Gradle build is so slow. Currently, every time you click build without changes, the build time is about 45 seconds. This is a single module project. I have enabled profiling and most of the time is spent on: app: dexDebug. We are building 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 any way to speed this up? Why does dex need to be restored every time?
source
share