Incremental Build for Android apps

Is Incremental build supported for Android apps? I thought I had enabled it but just realized that the setting I saw is “incremental dex mode.” I saw in this post from last year that “on Cocoa and Island, the Elements compiler now employs incremental compilation” but has this feature been added for Java/Android yet? If not, I would love to have it, since every build takes 2-3 minutes for me at the moment.


that’s a feature very specific to the native platforms, as it emits separate .o files for various classes, and only uptakes the ones affected by change. By contrast, Java builds to a single unified .jar file that has to be updated in one go. The closest equivalent here would be to build separate .jars (with all the limitations that entails wrt ending a clean tree of non-circular references), which can be achieved ow simply by building parts as separate libraries.

That said, I’ll bring this up for discussion to see if there are any parts that can be optimized.

Is that a full build, or the compile phase? Note the above Island/Cocoa change affects the compile phase only. If your compile pohjase for Android is that slow then (a) wow, but (b) I guess we need to look into what we can optimize.

M<ore importantly, if its just the whole build in general, we should review what parts actually take how long, and what to optimize (pre-dex, incremental dex, is D8 faster, maybe?)

Can you do a full build and an incremental “only a line of code changed” build using Debug level log verbosity, and check/share the statistics section at the end of the log?

1 Like