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?
The desugaring process rewrites your app's code to instead use this library at runtime. To enable support for these language APIs on any version of the Android platform, update the Android plugin to 4.0.0 (or higher) and include the following in your app module's build.gradle file: android {
D8: a next-generation DEX compiler The implications being that D8 could compile to DEX in 30% less time and produce smaller DEX files than DX. D8 also implements “desugaring”, so it can accept Java 8 code as input by default. As an extension to D8, R8 is a Java code shrinker built as a replacement for ProGuard.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With