Difference between android.enableD8.desugaring in Android Studio 3.1 and android.enableD8

0xAliHn picture 0xAliHn · Mar 28, 2018 · Viewed 7.9k times · Source

In Android Studio 3.0 there is an option android.enableD8 to enable D8 (Next-generation Dex Compiler). In Android Studio 3.1 a new option was added for this like android.enableD8.desugaring as per their updates.

What actually does android.enableD8.desugaring do in Android Studio 3.1 and what's the difference compared to the android.enableD8 option?

Answer

WoogieNoogie picture WoogieNoogie · Mar 28, 2018

The desugar step is executed normally after javac to optimize the bytecode. Enabling desugaring in D8 will remove that step entirely, and execute desugar as part of D8, making it faster and more optimized.

Source: https://android-developers.googleblog.com/2017/08/next-generation-dex-compiler-now-in.html