r/androiddev • • Oct 21 '26

Question DEX code optimization deadline, but R8 triggers "Unresponsive App" rejection

The Play Console is flagging my app with the DEX code optimization warning (requiring R8 shrinkage and obfuscation on release builds).

Here's the catch-22: Whenever I enable R8 for a release build, the app runs completely fine locally across my physical and virtual test devices. However, as soon as I submit it to Play Console (even on Closed Testing), the automated review bot rejects it for "Unresponsive app / Broken Functionality."

  • Telemetry Gap - Neither Android Vital nor Firebase Crashlytics records any crash or ANR during the review window.
  • Support Wall - Support refuses to provide stack traces, logcat dumps, or even clarify which version code failed.

Disabling R8 entirely and resubmitting allowed the app to pass review, proving R8 is triggering something specific on Google's automated test harness.

My app is an edge AI tool with a large local model footprint (2 GB). I suspect the R8 build might be breaking reflection in a background dependency or causing a thread lock or startup delay on their test labs that triggers an ANR.

Questions for the community:

  • Has anyone successfully debugged an R8-only rejection when Play Console refuses to provide logs?
  • How can I simulate the exact environment Google's automated review bots use during pre-launch?
4 Upvotes

18 comments sorted by

5

u/BambooXiu Oct 22 '26

If you're shipping a 2GB local model, Google's automated test bot is almost certainly running your release AAB on low-end virtual devices with strict 2GB to 3GB RAM caps. R8 likely stripped your JNI bridge classes or method signatures for the inference engine, causing a silent crash or an I/O hang that trips Google's 5-second startup timeout. Run a Robo test on Firebase Test Lab against a low-spec virtual device with your minified release build to get the actual logcat.

1

u/Pitiful-Squirrel4562 Oct 22 '26

Thanks for the insight, you're spot on about the JNI bridge. The app uses Google MediaPipe with a custom diffusion calculator, so JNI reflection lookups are definitely a possibility. The lowest spec device I've tested on via Firebase was a Pixel 6a API 33, but wasn't able to trigger the crash. Do you know the specific virtual device spec that best simulates Google's test environment?

1

u/BambooXiu Oct 24 '26

Pixel 6a has a Tensor chip and 6GB RAM, which easily masks cold start lag and memory pressure. To trigger the crash on FTL, try a physical Pixel 3a or an ARM virtual profile (MediumPhone.arm) rather than older x86 virtual Pixel 2s, since a custom diffusion calculator probably needs arm64-v8a and hardware GLES. Or honestly, just spin up a local arm64 AVD and throttle its RAM down to 2GB—loading a 2GB model there will blow it up pretty fast.
Also, make sure to add -keep class com.google.mediapipe.** { *; } (plus your custom JNI wrappers) so R8 doesn't strip the Packet reflection lookups. Good Luck~

2

u/Pitiful-Squirrel4562 Oct 26 '26

Thanks for the help! I'll try an ARM vm profile with less than 2GB RAM since the app requires API 33+. Good point on memory pressure, the model is loaded on first prompt, which could trigger an ANR. I do have ProGuard rules, needed for release builds to run locally, but something is still missing for Google's automated tests.

Since MediaPipe's Gallery app doesn't have an example, I made a request for one:
https://github.com/google-ai-edge/gallery/issues/1408

5

u/ObjectiveAddress3051 Oct 22 '26

if it only happens on the minified build I'd look at missing_rules.txt in build/outputs/mapping/release first. anything using reflection or JNI (model runtimes especially) can get stripped and you won't get a crash, just a screen that never loads. would also explain why crashlytics shows nothing

pre-launch report in play console is worth a look too, it has screenshots/video of what the test device actually saw. and make sure the 2GB model isn't loading on the main thread, review devices are usually pretty low end

1

u/Pitiful-Squirrel4562 Oct 22 '26

Thanks for the help! You're spot on about JNI, the app uses MediaPipe, it hanging silently probably explains the missing telemetry. I don't have a missing_rules.txt in build/outputs.

Also, good call on the report. In my Play Console, the Pre-Launch Report tab never seems to generate a report, I'm using the default settings which should be using Google's default Robo script.

4

u/Maherr11 Oct 21 '26

Is the app vibecoded?

0

u/Pitiful-Squirrel4562 Oct 21 '26

No. The app runs fine with R8 optimizations across my physical test devices and Firebase devices. The issue is strictly isolated to Google's test environment.

-10

u/hellosakamoto Oct 21 '26

Vibecode should not have this issue. It's only human who often can't properly configure R8

-1

u/Pitiful-Squirrel4562 Oct 21 '26

The app runs fine with R8 configured. It's failing only within Google's automation environment. Without a stack trace or log, it's impossible to know which call or class the obfuscation is breaking.

1

u/raaiinyyabelina 16d ago edited 16d ago

The missing_rules.txt not showing up is a sign R8 ran but didn't log removals, which sometimes happens when the mapping output path is misconfigured. For the review environment, Google's pre-launch Robo runs on low-end virtual devices, often 2GB RAM or less, so anything that blocks the main thread during startup will trip the ANR threshold even if it does not on your test hardware.

1

u/Pitiful-Squirrel4562 14d ago

Thanks for the suggestion! My tests, while using a release build on an API 33 virtual device with less than 2GBs, did not reproduce the ANR on startup unfortunately. The app doesn't request to download the local model until the app has started, and the model isn't loaded until after first prompt. The likely culprit is due to JNI reflection lookups during MediaPipe instantiation. I created a request from MediaPipe to provide official ProGuard rules:
https://github.com/google-ai-edge/gallery/issues/1408

1

u/Comfortable-Duty7143 16d ago

The main-thread load thing catches so many people. Moving it to a background co-routine with loading state fixed it for us too.

1

u/AutoModerator Oct 21 '26

Please note that we also have a very active Discord server where you can interact directly with other community members!

Join us on Discord

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

1

u/Pundrikaksha Oct 29 '26

Two things I'd check. First, open build/outputs/mapping/release/usage.txt and look for removed com.google.mediapipe or protobuf classes. MediaPipe and protobuf lite use reflection, so add -keep rules for both and see if the hang disappears. Second, the review bot probably launches on a low-RAM device. If the 2 GB model loads on the main thread or blocks the first frame, that reads as an ANR. Move it behind a progress UI on a background dispatcher. For logs, the Play Console pre-launch report on the closed track gives screenshots plus logcat. Glad to dig in over DM.

1

u/After-Rip5822 1d ago

This is usually not a real ANR in your app — it's the audit environment. Check the Pre-launch report first (Test and release > Pre-launch report), it runs Firebase Test Lab Robo test and lists the exact device / OS where it failed.

Also check if R8 stripped a class used by reflection — that's the classic release-only crash. If your Vitals ANR rate is under 0.47% but the audit still flags it, the audit device is likely a low-end model with slow dexopt on first launch. Try a clean install on a low-RAM emulator with the release AAB, not debug.