Android Release Crash: ClassNotFoundException / Empty JSON (R8 Shrinking)

R8 code shrinker stripped reflection-accessed data models in release builds.

Runs locally in browser Free · No login Independently Verified 2026-11-25 v4.1.0
Identifier: Android Release Crash Platform: Mobile
Common Root Causes:
  • R8 code shrinker stripped reflection-accessed data models in release builds.

Interactive Diagnostic Checklist

Verified Solutions:
  1. Annotate models with `@Keep`, use Kotlinx Serialization, or add targeted `-keep` rules in `proguard-rules.pro`.
Safe Diagnostic Command:
Inspect app/build/outputs/mapping/release/mapping.txt
Warning: Verify configuration changes in staging or with dry-run flags (e.g. nginx -t) before reloading production services.

Technical Explanation

R8 code shrinker stripped reflection-accessed data models in release builds. Recommended diagnostic: `Inspect app/build/outputs/mapping/release/mapping.txt`. Remediation: Annotate models with `@Keep`, use Kotlinx Serialization, or add targeted `-keep` rules in `proguard-rules.pro`.

Worked Examples

  • Run `Inspect app/build/outputs/mapping/release/mapping.txt` to verify root cause before applying the remediation.

Limitations & Assumptions

  • Always verify configuration changes in staging or with dry-run flags (e.g. `nginx -t`) before reloading production services.

Source References & Verification

Resource ID: err-android-r8-proguard-missing-class · Independently verified: 2026-11-25

Related Resources