A deep technical exploration of how Android's toolchain handles Java 8 language features, focusing on the desugaring process. Covers the history from Retrolambda through the Jack compiler to D8, explaining how lambdas and method references are transformed into Dalvik-compatible bytecode. Includes bytecode-level walkthroughs showing exactly how D8 converts lambdas into synthetic classes. Also addresses the gap between language feature desugaring (largely solved by D8) and API desugaring (e.g., java.time, streams), which still requires manual workarounds or bundled libraries. Argues that full Java 8 API desugaring is needed to unblock the broader Android and JVM library ecosystem.
Table of contents
LambdasDesugaring HistoryD8Source TransformationNative LambdasMethod ReferencesInterface MethodsJust Use Kotlin?Desugaring APIs1 Impression