Skip to content

fix(mobile): stop MainActivity.onDestroy from throwing under bridgeless - #14678

Merged
dylanjeffers merged 1 commit into
mainfrom
fix/mobile-android-ondestroy-bridgeless
Oct 19, 2026
Merged

dylanjeffers merged 1 commit into
mainfrom
fix/mobile-android-ondestroy-bridgeless

Conversation

@dylanjeffers

Copy link
Copy Markdown
Contributor

Summary

MainActivity.onDestroy emitted ForceQuitDetected through reactInstanceManager.currentReactContext. With the New Architecture on (1.5.189), ReactActivityDelegate builds its ReactDelegate from a ReactHost only. ReactDelegate.getReactInstanceManager() then throws IllegalStateException("Cannot get ReactInstanceManager without a ReactNativeHost."), so every destroy that isn't a configuration change crashes the process.

The likely trigger is the activity being destroyed while MusicService keeps the process alive: swiping the app out of Recents during playback, or the system reclaiming the activity in the background. Either way it kills playback.

Nothing in JS has listened for ForceQuitDetected since #13539, so this removes the override (and its two imports) instead of porting it to ReactHost.

Same class of bug as the RNTP bridgeless fix (#14647). This was the only other reactInstanceManager use in our Android sources, and the iOS sources have no bridge-only calls.

Shipping

It's a native-only change, so it ships in a native build. It's based on main, so it can go into a 1.5.189 rebuild if 1.5.189 isn't submitted yet, or otherwise into 1.5.190. Once 1.5.189 has some Android users, look in Play Console › Android vitals for IllegalStateException in ReactDelegate.getReactInstanceManager / MainActivity.onDestroy to confirm the impact.

Test plan

  • Android release build: play a track, swipe the app out of Recents, and check logcat for MainActivity.onDestroy / IllegalStateException
  • Developer options › "Don't keep activities": background the app and return to it, with no crash

🤖 Generated with Claude Code

onDestroy emitted ForceQuitDetected through reactInstanceManager. With the
new architecture on (1.5.189), ReactDelegate is built from a ReactHost and has
no ReactNativeHost, so getReactInstanceManager() throws IllegalStateException
and any non-configuration-change destroy crashes. Nothing in JS has listened
for ForceQuitDetected since #13539, so drop the override.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Oct 19, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 1becad4

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@dylanjeffers
dylanjeffers marked this pull request as ready for review October 19, 2026 20:30
@dylanjeffers
dylanjeffers merged commit 4a19802 into main Oct 19, 2026
3 checks passed
@dylanjeffers
dylanjeffers deleted the fix/mobile-android-ondestroy-bridgeless branch October 19, 2026 20:30
dylanjeffers added a commit that referenced this pull request Oct 19, 2026
## Summary

Version bump for native release **1.5.190**. Merging it starts the RC
and production native builds.

- `packages/mobile/package.json`: 1.5.189 → 1.5.190 (and the matching
`package-lock.json` entry)
- iOS `CFBundleShortVersionString`: 1.1.202 → 1.1.203
- Android `versionName`: 1.1.538 → 1.1.539

## Contents

- #14681: Reanimated 4.3.4 + Worklets 0.8.3, bottom-sheet 5.2.14, the
collapsible-tabs Reanimated 4 port, and mobile TypeScript 5.4.5
- #14680: drop the Android predictive-back opt-out
- #14682: FlashList 2.3.3. JS only, but it lands here so it ships in the
same RC. Podfile.lock drops RNFlashList.
- main through 4a19802, including #14678 (the Android `onDestroy`
crash under bridgeless)

## Release plan

Both stores are still on 1.5.186 (iOS 1.1.199, Android 1.1.535), so we
skip a 1.5.189 store release and ship 1.5.190 directly. The 1.5.189 RC
builds stay in TestFlight and Play internal as the comparison build. If
something regresses on 1.5.190, check it on 1.5.189 to tell a Reanimated
4/FlashList change from a new-architecture one.

Device QA on the 1.5.190 RC covers the 1.5.189 checklist (#14656/#14657)
plus the Reanimated 4 list in #14681. Then submit to both stores with
phased/staged rollouts. 1.5.186 users keep getting production OTAs
through the `binary_version` path until they update.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant