Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[0.74] Performing a refresh is unstable under Bridge Mode on Android (RNTester / New Arch) #43692

Closed
huntie opened this issue Mar 28, 2024 · 3 comments
Assignees
Labels
DX Issues concerning how the developer experience can be improved. Platform: Android Android applications. Type: New Architecture Issues and PRs related to new architecture (Fabric/Turbo Modules)

Comments

@huntie
Copy link
Member

huntie commented Mar 28, 2024

Description

Performing a refresh is leading to some lifecycle error that results in a black screen.

Affects 0.74-stable and main.

Steps to reproduce

  1. Install RNTester on Android, having disabled Bridgeless (-> Bridge Mode).
    image
  2. Open Dev Menu and trigger a reload.
    • 🎯 This will randomly fail and display a blank screen. See video (on attempt 3).

React Native Version

0.74.0, main

Affected Platforms

Runtime - Android

Areas

Bridgeless - The New Initialization Flow

Output of npx react-native info

Stacktrace or Logs

manager.UIManagerHelper  E  Unhandled SoftException
                         E  com.facebook.react.bridge.ReactNoCrashSoftException: Cannot get UIManager because the context doesn't contain an active CatalystInstance.
                         E      at com.facebook.react.uimanager.UIManagerHelper.getUIManager(UIManagerHelper.java:82)
                         E      at com.facebook.react.uimanager.UIManagerHelper.getEventDispatcher(UIManagerHelper.java:134)
                         E      at com.facebook.react.uimanager.UIManagerHelper.getEventDispatcherForReactTag(UIManagerHelper.java:112)
                         E      at com.facebook.react.internal.interop.InteropEventEmitter.receiveEvent(InteropEventEmitter.kt:37)
                         E      at com.facebook.react.uimanager.events.ReactEventEmitter.receiveEvent(ReactEventEmitter.java:146)
                         E      at com.facebook.react.uimanager.events.ReactEventEmitter.receiveEvent(ReactEventEmitter.java:65)
                         E      at com.facebook.react.uimanager.events.ReactEventEmitter.receiveEvent(ReactEventEmitter.java:58)
                         E      at com.facebook.react.uimanager.events.Event.dispatch(Event.java:173)
                         E      at com.facebook.react.uimanager.events.Event.dispatchModern(Event.java:209)
                         E      at com.facebook.react.uimanager.events.EventDispatcherImpl$DispatchEventsRunnable.run(EventDispatcherImpl.java:376)
                         E      at android.os.Handler.handleCallback(Handler.java:958)
                         E      at android.os.Handler.dispatchMessage(Handler.java:99)
                         E      at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:27)
                         E      at android.os.Looper.loopOnce(Looper.java:205)
                         E      at android.os.Looper.loop(Looper.java:294)
                         E      at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:235)
                         E      at java.lang.Thread.run(Thread.java:1012)

Reproducer

https://github.com/facebook/react-native/tree/main/packages/rn-tester

Screenshots and Videos

Screen.Recording.2024-03-28.at.13.58.29.mov
@huntie huntie added Needs: Triage 🔍 Type: New Architecture Issues and PRs related to new architecture (Fabric/Turbo Modules) labels Mar 28, 2024
@github-actions github-actions bot added Needs: Author Feedback Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. labels Mar 28, 2024
Copy link

⚠️ Missing Reproducible Example
ℹ️ We could not detect a reproducible example in your issue report. Please provide either:
  • If your bug is UI related: a Snack
  • If your bug is build/update related: use our Reproducer Template. A reproducer needs to be in a GitHub repository under your username.

@github-actions github-actions bot added the Platform: Android Android applications. label Mar 28, 2024
@cortinico cortinico added DX Issues concerning how the developer experience can be improved. and removed Needs: Triage 🔍 Needs: Author Feedback Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. labels Mar 28, 2024
cortinico added a commit to cortinico/react-native that referenced this issue Apr 9, 2024
Summary:
Currently NewArch-BridgeMode is partially broken when creating views via `ReactDelegate`.
That's because we're using the ctor that doesn't account for `Boolean: fabricEnabled`.

That means that the `RootView` that it will be created are all having setIsFabric(FALSE).
This is causing problems like whitescreens on several reload + multiple warnings such as:
```
                         E  com.facebook.react.bridge.ReactNoCrashSoftException: Cannot get UIManager because the context doesn't contain an active CatalystInstance.
```

Fixes facebook#43692

See for more context on this issues: facebook#43692

Changelog:
[Android] [Fixed] - Fix bridge mode by constructing ReactDelegate correctly

Reviewed By: cipolleschi

Differential Revision: D55921078
@cortinico
Copy link
Contributor

This is indeed an issue, and the fix is here #43999

cortinico added a commit that referenced this issue Apr 9, 2024
Summary:
Pull Request resolved: #43999

Currently NewArch-BridgeMode is partially broken when creating views via `ReactDelegate`.
That's because we're using the ctor that doesn't account for `Boolean: fabricEnabled`.

That means that the `RootView` that it will be created are all having setIsFabric(FALSE).
This is causing problems like whitescreens on several reload + multiple warnings such as:
```
                         E  com.facebook.react.bridge.ReactNoCrashSoftException: Cannot get UIManager because the context doesn't contain an active CatalystInstance.
```

Fixes #43692

See for more context on this issues: #43692

Changelog:
[Android] [Fixed] - Fix bridge mode by constructing ReactDelegate correctly

Reviewed By: cipolleschi

Differential Revision: D55921078

fbshipit-source-id: 2c21d089a49538402d546177bcdb26c8d7d5fbc1
@cortinico
Copy link
Contributor

✅ Picked, this will land in 0.74 RC8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DX Issues concerning how the developer experience can be improved. Platform: Android Android applications. Type: New Architecture Issues and PRs related to new architecture (Fabric/Turbo Modules)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants