Android Developers Backstage Android Developers Backstage

What's so great about R8?

Feb 18, 2026 · 1h 6m

Summary

This episode features Tor Norby, Romain Guy, Sean from the R8 team, Chris from DevX Performance, and Shai from Platform Performance discussing R8, Android’s whole-program optimizing compiler. They explain how R8 improves app performance by removing dead code, inlining methods, and merging interfaces, often yielding significant startup speedups and reduced ANRs. The team highlights the importance of proper keep rules to handle reflection and JNI, warning against overly broad rules that hinder optimization. They also cover recent improvements in developer experience, including better document…

Topics discussed

Introduction to R8 and D8 compilers Why two compilers: Debug vs Release optimization Reflection, JNI, and the need for keep rules Tree shaking, inlining, and interface merging Baseline profiles and ART compiler hints DEX file locality and startup code optimization Performance gains and ANR reduction with R8 Kotlin null checks and compiler optimizations Debugging obfuscated stack traces Keep rules, ProGuard migration, and JSON libraries Testing shrinking behavior and Compose optimizations R8 limitations for non-Android Java bytecode Reflection annotations and conditional keep rules Resource shrinking and platform feature flags R8 adoption impact on app performance
Listen ad-free on Castria