How it works
R8 is the Android build's code shrinker. With isMinifyEnabled switched on for release builds, it removes classes and methods nothing uses, optimises the rest, renames classes and members to short meaningless names (obfuscation), and converts the result into the DEX format Android runs. isShrinkResources then drops unused images and layouts. ProGuard, from Guardsquare, is the older tool R8 replaced, and its rule syntax lives on in proguard-rules.pro files.
Code reached only through reflection, or JSON parsed by field name, can be removed or renamed by mistake, so libraries ship keep rules and apps add their own; testing the release build, not only debug, catches this. R8 writes a mapping.txt file that turns obfuscated crash stack traces back into readable ones, and Play Console can use it to show readable crash reports. Obfuscation slows reverse engineering but does not stop it.
R8 and ProGuard pricing
Free
Free. R8 ships with the Android Gradle plugin, and ProGuard is open source (GPL 2.0).
Approximate, checked September 2026.What the other tools cost
Related terms
More in Mobile apps
Android building blocks