Test the Release Build, Not Just Debug: R8 and Minification Checks Before a Google Play Closed Test

If your app runs fine from Android Studio but crashes on a tester's phone at launch, the cause is often the build, not your code. Closed test builds are release builds. Release builds are shrunk, obfuscated and signed differently from the debug builds you run every day.
This post covers how to test the release variant yourself before you upload it, which problems usually show up, and what to ask testers to check.
Why debug and release builds behave differently
A debug build is forgiving. A release build usually changes several things at once:
- Code shrinking and obfuscation (R8). Unused classes and methods are removed, and the rest are renamed. Anything your app finds by name at runtime can break.
- Resource shrinking. Resources that look unused are removed. Resources loaded by a dynamically built name can go missing.
- The debuggable flag. Release builds are not debuggable, so timing, logging and some WebView behavior can differ.
- Signing. The certificate differs from your debug key, and with Play App Signing the certificate users get can differ again from your upload key.
- Build config values. API base URLs, feature flags and keys often vary by build type.
Whether minification is on depends on your Gradle config (isMinifyEnabled in the release build type). If it is off, you skip the R8 problems below, but check your other release settings anyway. For details on how shrinking works, see the official shrink, obfuscate and optimize guide.
Step 1: Install the release variant on a real phone
Before you upload anything, build the release variant with your real signing config and install it on a physical device. Do not test it only through the IDE's debug run button.
- Build the release variant (for example
./gradlew assembleRelease, or whatever your project uses). - Uninstall any debug build first. Different signing keys will conflict.
- Install the release APK with
adb install. - Use the app for a full session, not just a launch.
If you build an AAB for Play, you can also test it locally with Google's bundletool, which generates device-specific APKs from the bundle. That is closer to what testers will actually install.
Step 2: Know where R8 usually breaks things
Most release-only crashes come from a short list of causes. Check each one in your own code and libraries:
- JSON models with reflection. Libraries such as Gson read field names at runtime. If R8 renames the fields, parsing quietly returns nulls or throws. Symptom: screens that load data look empty in release only.
- Classes loaded by name. Anything created through
Class.forName, or declared in a manifest or config file by class name, needs to survive shrinking. - JavaScript interfaces in WebView. Methods exposed to web content can be renamed or removed.
- Native (JNI) code. Native methods are looked up by name and signature.
- Enums, Serializable and Parcelable. Custom serialization or
valueOfby string can fail after renaming. - Older or niche libraries. Many libraries ship their own consumer rules. Some do not, so check their documentation.
Typical error messages include ClassNotFoundException, NoSuchMethodException, NoSuchFieldException and Resources$NotFoundException. Seeing one of these only in release is a strong hint that R8 is involved.
Step 3: Fix it with targeted keep rules
When you find a broken class, add a narrow rule to your ProGuard rules file. For example, to keep your API model classes:
-keep class com.example.app.data.model.** { *; }
Be as specific as you can. A rule that keeps your whole package works, but it undoes much of the shrinking and can hide the next problem. Rebuild, reinstall and repeat the same session until the behavior matches debug.
Also, read the build output. R8 prints warnings about missing classes. Some are harmless, but a warning about a class your app really uses deserves a look before you upload.
Step 4: Keep the mapping file so crashes are readable
Obfuscated stack traces look like at a.b.c.d(SourceFile:12), which is useless without the mapping file. The file is generated at app/build/outputs/mapping/release/mapping.txt in a typical setup. For app bundles built with minification on, the Android Gradle Plugin usually includes the mapping in the bundle, and Play Console can use it to deobfuscate crash reports. How this works can change, so if your traces still look scrambled, check Play Console Help for the current steps on deobfuscation files.
Archive the mapping file for every build you upload, labeled by version code. Without it, a tester's crash report may be impossible to read. If you want the broader workflow for crashes, see our post on handling crashes reported during a closed test.
Step 5: Check the release-only settings
Beyond R8, run through this short list on the release build:
- Sign-in and keyed services. Google Sign-In, Maps or any API key restricted by signing certificate fingerprint may fail if the fingerprint for your Play-distributed build is not registered. With Play App Signing, the fingerprint on devices is Google's app signing key, not your upload key. You can find it in Play Console under the app signing page.
- Base URLs and flags. Confirm the release build points at the production or staging server you intend, not
localhostor a debug endpoint. - Cleartext traffic. A debug-only network security config can allow HTTP that release blocks.
- Logging and debug menus. Remove debug screens, test accounts and verbose logging that print user data.
- Version code. It must be higher than any build already uploaded to any track.
- Crash reporting. Confirm your crash reporter initializes in release, or you will not see failures.
Step 6: Ask testers targeted questions
Even a careful local check misses things, because testers use different devices, Android versions and data. Give them specific prompts, not just "let us know what you think":
- Did the app open on the first try after installing?
- Did every screen that loads data show content?
- Did sign-in work?
- Did anything close unexpectedly? If so, what were you doing?
On TesterMob, testers use your app on their own Android phones for about 20 minutes a day and write feedback, so you get several sessions on real devices. If you add the optional Android SDK (an .aar file), your dashboard shows daily tester activity, which helps you see whether people got past a launch crash or stopped opening the app. You can read how that works on the developer page.
If you find a release-only bug mid-test
Fix it, bump the version code, rebuild the release, repeat the local install check, and upload the update to the same closed testing track. Testers receive it as an ordinary update. Write a clear release note saying what changed so they know what to retest.
Rules around closed testing and production access can change, and no testing service can guarantee Google's approval. Check Play Console Help for the current requirements, and see the FAQ for how TesterMob fits into the process.
Quick pre-upload checklist
- Build the signed release variant.
- Install it on a real phone after removing the debug build.
- Walk through the main flows, including sign-in and data screens.
- Scan the R8 warnings and add narrow keep rules where needed.
- Archive the mapping file with the version code.
- Confirm signing fingerprints for any keyed services.
- Upload, then ask testers the targeted questions above.
Twenty minutes with the release build on your own phone is cheaper than discovering a launch crash across a whole group of testers.