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

Android - App is crashing when performing multiple navigations after upgrading RN to 0.76 #2636

Open
NJ-2020 opened this issue Jan 20, 2025 · 3 comments
Labels
Platform: Android This issue is specific to Android Repro provided A reproduction with a snack or repo is provided

Comments

@NJ-2020
Copy link

NJ-2020 commented Jan 20, 2025

Description

When tapping the link inside the chat, the android app is crashing/exits, here's the error log:

SurfaceMountingManager: Unhandled SoftException

SurfaceMountingManager: java.lang.IllegalStateException: addViewAt: cannot insert view [3620] into parent [3622]: View already has a parent: [3626]  Parent: Screen View: ReactViewGroup

SurfaceMountingManager: 	at com.facebook.react.fabric.mounting.SurfaceMountingManager.addViewAt(SourceFile:139)

SurfaceMountingManager: 	at com.facebook.react.fabric.mounting.mountitems.IntBufferBatchMountItem.execute(SourceFile:248)

SurfaceMountingManager: 	at com.facebook.react.fabric.mounting.MountItemDispatcher.executeOrEnqueue(SourceFile:54)

SurfaceMountingManager: 	at com.facebook.react.fabric.mounting.MountItemDispatcher.dispatchMountItems(SourceFile:46)

SurfaceMountingManager: 	at com.facebook.react.fabric.mounting.MountItemDispatcher.tryDispatchMountItems(SourceFile:35)

SurfaceMountingManager: 	at com.facebook.react.fabric.FabricUIManager$DispatchUIFrameCallback.doFrameGuarded(SourceFile:95)

SurfaceMountingManager: 	at com.facebook.react.fabric.GuardedFrameCallback.doFrame(SourceFile:1)

SurfaceMountingManager: 	at com.facebook.react.modules.core.ReactChoreographer.frameCallback$lambda$1(SourceFile:37)

SurfaceMountingManager: 	at com.facebook.react.modules.core.ReactChoreographer.a(SourceFile:1)

SurfaceMountingManager: 	at com.facebook.react.modules.core.a.doFrame(SourceFile:26)

SurfaceMountingManager: 	at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1229)

SurfaceMountingManager: 	at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1239)

SurfaceMountingManager: 	at android.view.Choreographer.doCallbacks(Choreographer.java:899)

SurfaceMountingManager: 	at android.view.Choreographer.doFrame(Choreographer.java:827)

SurfaceMountingManager: 	at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1214)

SurfaceMountingManager: 	at android.os.Handler.handleCallback(Handler.java:942)

SurfaceMountingManager: 	at android.os.Handler.dispatchMessage(Handler.java:99)

SurfaceMountingManager: 	at android.os.Looper.loopOnce(Looper.java:201)

SurfaceMountingManager: 	at android.os.Looper.loop(Looper.java:288)

SurfaceMountingManager: 	at android.app.ActivityThread.main(ActivityThread.java:7924)

SurfaceMountingManager: 	at java.lang.reflect.Method.invoke(Native Method)

SurfaceMountingManager: 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)

SurfaceMountingManager: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)

Steps to reproduce

  1. Clone the repo app
  2. Install the packages using npm install, note: only use NPM instead of bun/yarn/pnpm, because using other package-manager may cause the installation process to failed
  3. Setup the mapbox by running this command npm run configure-mapbox and when asked for mapbox token, use this token: sk.eyJ1IjoiaGF5YXRhIiwiYSI6ImNsbG11NjRqcDI5aDUzZnFsemQ1bzJ6a2sifQ.0w52KN5Ak4AMiwiW-MnWHg
  4. Run the android application by running this command npm run android
  5. Once the app is successfully running, login/create new account
  6. Create workspace/ or start dm with any people
  7. Open any chat
  8. Paste this link to the input https://dev.new.expensify.com:8082/settings/workspaces/D14467B7F87F1292/[email protected]
  9. Tap on the link
  10. The app is crashing/exits
Bug6713710_1736843501983.Screen_Recording_20250114_153950_Device_care.1.mp4

Snack or a link to a repository

https://github.com/NJ-2020/Expensify/

Screens version

3.35.0

React Native version

0.76.3

Platforms

Android

JavaScript runtime

Hermes

Workflow

Expo managed workflow

Architecture

Fabric (New Architecture)

Build type

Debug mode

Device

Android emulator

Device model

Emulator Pixel 8 API 35

Acknowledgements

Yes

@kkafar
Copy link
Member

kkafar commented Jan 20, 2025

Hey, while you posted an reproduction, the Expensify app is nowhere near minimal reproducible example (MRE). There are tons of custom code & dependencies which might affect the app behaviour. Would you be able to provide me with something more bare bone and closer to MRE that might actually indicate in more convincing way that the issue is related to react-native-screens?

@kkafar kkafar added the Close when stale This issue is going to be closed when there is no activity for a while label Jan 20, 2025
@NJ-2020
Copy link
Author

NJ-2020 commented Jan 20, 2025

@kkafar Hi, sure, can I share the new error logs:

SurfaceMountingManager: Unhandled SoftException

SurfaceMountingManager: java.lang.IllegalStateException: addViewAt: cannot insert view [3620] into parent [3622]: View already has a parent: [3626]  Parent: Screen View: ReactViewGroup

SurfaceMountingManager: 	at com.facebook.react.fabric.mounting.SurfaceMountingManager.addViewAt(SourceFile:139)

SurfaceMountingManager: 	at com.facebook.react.fabric.mounting.mountitems.IntBufferBatchMountItem.execute(SourceFile:248)

SurfaceMountingManager: 	at com.facebook.react.fabric.mounting.MountItemDispatcher.executeOrEnqueue(SourceFile:54)

SurfaceMountingManager: 	at com.facebook.react.fabric.mounting.MountItemDispatcher.dispatchMountItems(SourceFile:46)

SurfaceMountingManager: 	at com.facebook.react.fabric.mounting.MountItemDispatcher.tryDispatchMountItems(SourceFile:35)


SurfaceMountingManager: 	at com.facebook.react.fabric.FabricUIManager$DispatchUIFrameCallback.doFrameGuarded(SourceFile:95)

SurfaceMountingManager: 	at com.facebook.react.fabric.GuardedFrameCallback.doFrame(SourceFile:1)

SurfaceMountingManager: 	at com.facebook.react.modules.core.ReactChoreographer.frameCallback$lambda$1(SourceFile:37)

SurfaceMountingManager: 	at com.facebook.react.modules.core.ReactChoreographer.a(SourceFile:1)

SurfaceMountingManager: 	at com.facebook.react.modules.core.a.doFrame(SourceFile:26)

SurfaceMountingManager: 	at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1229)

SurfaceMountingManager: 	at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1239)

SurfaceMountingManager: 	at android.view.Choreographer.doCallbacks(Choreographer.java:899)

SurfaceMountingManager: 	at android.view.Choreographer.doFrame(Choreographer.java:827)

SurfaceMountingManager: 	at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1214)


SurfaceMountingManager: 	at android.os.Handler.handleCallback(Handler.java:942)

SurfaceMountingManager: 	at android.os.Handler.dispatchMessage(Handler.java:99)

SurfaceMountingManager: 	at android.os.Looper.loopOnce(Looper.java:201)

SurfaceMountingManager: 	at android.os.Looper.loop(Looper.java:288)

SurfaceMountingManager: 	at android.app.ActivityThread.main(ActivityThread.java:7924)

SurfaceMountingManager: 	at java.lang.reflect.Method.invoke(Native Method)

SurfaceMountingManager: 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)

SurfaceMountingManager: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)

I think based on error logs we're trying to insert view into a parent view that already has a parent but I am not sure which file is causing this issue

And also I've tried to upgrade to the latest versions of react-native-screens and the error still occurs

@github-actions github-actions bot removed the Close when stale This issue is going to be closed when there is no activity for a while label Jan 20, 2025
@NJ-2020
Copy link
Author

NJ-2020 commented Jan 20, 2025

And also this issue is not occurring before we upgrade to RN 0.76 for more details here's the PR

And the issue only occurs if we perform multiple navigations only in Android native and if I remove the navigation function the error is gone

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Platform: Android This issue is specific to Android Repro provided A reproduction with a snack or repo is provided
Projects
None yet
Development

No branches or pull requests

2 participants