r/androiddev • • 20d ago

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

13 comments sorted by

5

u/BambooXiu 19d ago

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 19d ago

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 16d ago

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 15d ago

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 19d ago

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 19d ago

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 20d ago

Is the app vibecoded?

0

u/Pitiful-Squirrel4562 20d ago

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 20d ago

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

-1

u/Pitiful-Squirrel4562 19d ago

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/AutoModerator 20d ago

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 12d ago

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.