software-mansion / react-native-screens

Native navigation primitives for your React Native app.
https://docs.swmansion.com/react-native-screens/
MIT License
3.09k stars 521 forks source link

(Android - Crash): FragmentManager is already executing transactions #1506

Closed luislukas closed 2 years ago

luislukas commented 2 years ago

Description

When react native screens are enabled on Android and the architecture is based on a single Activity plus React native is loaded in a Fragment, there's a crash when navigating and restoring the fragment state.

Having a single Activity app and using Fragments with navigation components as describe here brings us to load React Native apps on a Fragment. We also want to enable React native screens, however, when enabled on Android, there's the following crash: java.lang.RuntimeException: Unable to resume activity {com.swmansion.rnscreens.example/com.swmansion.rnscreens.example.MainActivity}: java.lang.IllegalStateException: FragmentManager is already executing transactions at android.app.ActivityThread.performResumeActivity(ActivityThread.java:4445) at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:4477) at android.app.servertransaction.ResumeActivityItem.execute(ResumeActivityItem.java:52) at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:176) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2067) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:223) at android.app.ActivityThread.main(ActivityThread.java:7697) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:952) Caused by: java.lang.IllegalStateException: FragmentManager is already executing transactions at androidx.fragment.app.FragmentManager.ensureExecReady(FragmentManager.java:1686) at androidx.fragment.app.FragmentManager.execSingleAction(FragmentManager.java:1716) at androidx.fragment.app.BackStackRecord.commitNowAllowingStateLoss(BackStackRecord.java:323) at com.swmansion.rnscreens.ScreenContainer.removeMyFragments(ScreenContainer.kt:216) at com.swmansion.rnscreens.ScreenContainer.onDetachedFromWindow(ScreenContainer.kt:228) at android.view.View.dispatchDetachedFromWindow(View.java:20538) at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3942) at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3934) at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3934) at android.view.ViewGroup.removeViewInternal(ViewGroup.java:5560) at android.view.ViewGroup.removeViewInternal(ViewGroup.java:5531) at android.view.ViewGroup.removeView(ViewGroup.java:5462) at androidx.fragment.app.FragmentContainerView.removeView(FragmentContainerView.kt:288) at androidx.fragment.app.SpecialEffectsController$Operation$State.applyState(SpecialEffectsController.java:470) at androidx.fragment.app.DefaultSpecialEffectsController.applyContainerChanges(DefaultSpecialEffectsController.java:822) at androidx.fragment.app.DefaultSpecialEffectsController$1.run(DefaultSpecialEffectsController.java:111) at androidx.fragment.app.SpecialEffectsController$Operation.complete(SpecialEffectsController.java:713) at androidx.fragment.app.SpecialEffectsController$FragmentStateManagerOperation.complete(SpecialEffectsController.java:770) at androidx.fragment.app.SpecialEffectsController$Operation.completeSpecialEffect(SpecialEffectsController.java:690) at androidx.fragment.app.DefaultSpecialEffectsController$SpecialEffectsInfo.completeSpecialEffect(DefaultSpecialEffectsController.java:855) at androidx.fragment.app.DefaultSpecialEffectsController.startAnimations(DefaultSpecialEffectsController.java:154) at androidx.fragment.app.DefaultSpecialEffectsController.executeOperations(DefaultSpecialEffectsController.java:123) at androidx.fragment.app.SpecialEffectsController.executePendingOperations(SpecialEffectsController.java:306) at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:1903) at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:1814) at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:1751) at androidx.fragment.app.Fragment.performResume(Fragment.java:3177) at androidx.fragment.app.FragmentStateManager.resume(FragmentStateManager.java:606) at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:285) 2022-07-03 22:00:08.008 30152-30152/com.swmansion.rnscreens.example E/AndroidRuntime: at androidx.fragment.app.FragmentStore.moveToExpectedState(FragmentStore.java:113) at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1424) at androidx.fragment.app.FragmentManager.dispatchStateChange(FragmentManager.java:2968) at androidx.fragment.app.FragmentManager.dispatchResume(FragmentManager.java:2900) at androidx.fragment.app.FragmentController.dispatchResume(FragmentController.java:285) at androidx.fragment.app.FragmentActivity.onResumeFragments(FragmentActivity.java:334) at androidx.fragment.app.FragmentActivity.onPostResume(FragmentActivity.java:323) at androidx.appcompat.app.AppCompatActivity.onPostResume(AppCompatActivity.java:204) at android.app.Activity.performResume(Activity.java:8160) at android.app.ActivityThread.performResumeActivity(ActivityThread.java:4435)

The reason of the crash seems to be:

Screenshots

Steps To Reproduce

To reproduce, I've recreated in the Example app a common use case: Load React native, put the app in the background and trigger a deep link. I've prepared the Example to do this so the steps are:

  1. Launch the Example app
  2. Tap Stack Presentation
  3. Tap Form Sheet
  4. Put some values in the form.
  5. Background the app
  6. Launch the following adb comand: adb shell am start -W -a android.intent.action.VIEW -d "screens://screens" com.swmansion.rnscreens.example

Expected behavior

The react native screen should display without a crash

Actual behavior

Crash with the above stack trace

Reproduction

To reproduce the crash I've forked react-native-screens github project and modified the example with the described architecture. The project can be found here: https://github.com/luislukas/react-native-screens

I reported this issue originally on https://github.com/software-mansion/react-native-screens/issues/819 but due to our architecture we had to disable react-native-screens. We would like to enable them now so any hint/help would be appreciated.

Platform

Architecture

I've forked the react-native-screens and added the Navigation Componentes plus Fragments architecture described aboved.

Workflow

Package versions

I'm using a fork of this project just changing the Android project architecture.

package version
react-native
@react-navigation/native
@react-navigation/native-stack
react-native-screens
react-native-safe-area-context
react-native-gesture-handler
react-native-reanimated
expo
luislukas commented 2 years ago

I've been further investigating this and found something that could help shine some light on the crash: in ScreenContainer.removeMyFragments(fragmentManager) I've added some logs to see if any Fragment is removed at all. The logs display the Fragments associated with the FragmentManager ie. fragmentManager.fragments. if we get:

fragmentManager.fragments: [ScreenFragment{c20e2bd} (20a623a6-f0b5-4423-a07f-240e41a98f64 id=0x1d9)] primaryNavigationFragment: null

All is fine, there's no crash. However, if we have something like:

fragmentManager.fragments: [NavHostFragment{5ba4d08} (f3cc56af-e83b-412f-850d-9c703028f04c id=0x7f0a0321), ScreenFragment{ffb6ca1} (d6633363-317c-45fe-842d-680a62c44bbf id=0x23d)] primaryNavigationFragment: NavHostFragment{5ba4d08} (f3cc56af-e83b-412f-850d-9c703028f04c id=0x7f0a0321) removing fragments: ScreenFragment{ffb6ca1} (d6633363-317c-45fe-842d-680a62c44bbf id=0x23d)

Then the crash happens. My guess is that this FragmentManager is the one used in the NavigationComponents and is the one doing some work at the moment.

jamninetyfive commented 2 years ago

same here. how to sloved?

nvu commented 2 years ago

Since the pending transaction is the reason, I patched a few lines and the error has seems to resolved in your example project.

https://github.com/software-mansion/react-native-screens/blob/07a92e90651cf30d7b207ff8910d0251c5b10168/android/src/main/java/com/swmansion/rnscreens/ScreenContainer.kt#L215-L217 ->

if (hasFragments) { 
    transaction.commitAllowingStateLoss() //transaction.commitNowAllowingStateLoss()
}

https://github.com/software-mansion/react-native-screens/blob/07a92e90651cf30d7b207ff8910d0251c5b10168/android/src/main/java/com/swmansion/rnscreens/ScreenContainer.kt#L227-L230 ->

if (!it.isDestroyed) {
    removeMyFragments(it)
    //it.executePendingTransactions()
}

But I could not make a pull request cause I did n't dig deep the codes yet.. :/ There may be other reasons had to call commitNow() and executePendingTransactions().

luislukas commented 2 years ago

@nvu I did try something similar and is true that doesn't crash but the problem is that the views are not getting updated ie. you can navigate back and forth and because we are not executing changes the views start disappearing. Indeed It is related to the fragment transactions and to which FragmentManager each ScreenContainer is associated since is set that with the set parameter.

kkafar commented 2 years ago

Hi @nvu @luislukas! I dived into it and came up with (I hope) proper solution: https://github.com/software-mansion/react-native-screens/pull/1553

Would you mind checking these changes out and letting me know whether it works for you?

You can put following line in your package.json

"react-native-screens": "software-mansion/react-native-screens#@kkafar/fix-1506
luislukas commented 2 years ago

@kkafar thanks for looking into this.

Looks like is working so far and can't reproduce the crash, so this is really great news!. I'll get the changes to a full round of tests with more people and automated tests in place. Anything I find I'll posted here.

Thanks again!

pavalep commented 2 years ago

@luislukas @kkafar Thanks, bros !! "react-native-screens": "software-mansion/react-native-screens#@kkafar/fix-1506" This is a working solution.

lvst09 commented 2 years ago

Hi @nvu @luislukas! I dived into it and came up with (I hope) proper solution: #1553

Would you mind checking these changes out and letting me know whether it works for you?

You can put following line in your package.json

"react-native-screens": "software-mansion/react-native-screens#@kkafar/fix-1506

now this version cannot be installed by yarn and why

kkafar commented 2 years ago

Hi @lvst09, the branch was deleted when the PR got merged to main. You can use:

"react-native-screens": "software-mansion/react-native-screens#main

temporarily - until we release version 3.16 (coming soon)

lvst09 commented 2 years ago
"react-native-screens": "software-mansion/react-native-screens#main

yes it works thank u

cw-sanjeev commented 1 year ago

@kkafar Is this issue fixed, from what i understand by release notes, in v3.17.0, this fix was reverted

kkafar commented 1 year ago

Hi @cw-sanjeev, there were actually a few PRs (two I believe) that messed with how the error is handled if it actually appears, but the logic that was meant to fix this (and prevent the error from occurring) stayed.

Do you still see this error (on recent versions of react-native-screens)?

rifad4u commented 1 year ago

I'm facing this issue in the production in the 3.18.2th version.

kkafar commented 1 year ago

@rifad4u, what's your setup? Could you provide a reproduction?

rifad4u commented 1 year ago

@kkafar I'm unable to reproduce the issue and don’t know where it is happening since this issue is happening in production. Please find the crash log below

Caused by java.lang.IllegalStateException: FragmentManager is already executing transactions at androidx.fragment.app.FragmentManager.ensureExecReady(FragmentManager.java:1931) at androidx.fragment.app.FragmentManager.execSingleAction(FragmentManager.java:1967) at androidx.fragment.app.BackStackRecord.commitNowAllowingStateLoss(BackStackRecord.java:311) at com.swmansion.rnscreens.ScreenContainer.onUpdate(ScreenContainer.kt:366) at com.swmansion.rnscreens.ScreenContainer.performUpdates(ScreenContainer.kt:311) at com.swmansion.rnscreens.ScreenContainer.performUpdatesNow(ScreenContainer.kt:303) at com.swmansion.rnscreens.ScreenContainer.notifyChildUpdate(ScreenContainer.kt:87) at com.swmansion.rnscreens.Screen.setActivityState(Screen.kt:132) at com.swmansion.rnscreens.ScreenViewManager.setActivityState(ScreenViewManager.kt:49) at com.swmansion.rnscreens.ScreenViewManager.setActivityState(ScreenViewManager.kt:34) at com.swmansion.rnscreens.ScreenViewManager.setActivityState(ScreenViewManager.kt:21) at com.facebook.react.viewmanagers.RNSScreenManagerDelegate.setProperty(RNSScreenManagerDelegate.java:81) at com.facebook.react.uimanager.ViewManagerPropertyUpdater.updateProps(ViewManagerPropertyUpdater.java:46) at com.facebook.react.uimanager.ViewManager.updateProperties(ViewManager.java:84) at com.facebook.react.uimanager.NativeViewHierarchyManager.updateProperties(NativeViewHierarchyManager.java:142) at com.facebook.react.uimanager.UIImplementation.synchronouslyUpdateViewOnUIThread(UIImplementation.java:306) at com.facebook.react.uimanager.UIManagerModule.synchronouslyUpdateViewOnUIThread(UIManagerModule.java:402) at com.facebook.react.animated.PropsAnimatedNode.updateView(PropsAnimatedNode.java:118) at com.facebook.react.animated.NativeAnimatedNodesManager.updateNodes(NativeAnimatedNodesManager.java:747) at com.facebook.react.animated.NativeAnimatedNodesManager.handleEvent(NativeAnimatedNodesManager.java:600) at com.facebook.react.animated.NativeAnimatedNodesManager.onEventDispatch(NativeAnimatedNodesManager.java:562) at com.facebook.react.uimanager.events.EventDispatcherImpl.dispatchEvent(EventDispatcherImpl.java:116) at com.reactnativepagerview.PagerViewViewManager$createViewInstance$1$1.onPageScrolled(PagerViewViewManager.kt:43) at androidx.viewpager2.widget.CompositeOnPageChangeCallback.onPageScrolled(CompositeOnPageChangeCallback.java:59) at androidx.viewpager2.widget.CompositeOnPageChangeCallback.onPageScrolled(CompositeOnPageChangeCallback.java:59) at androidx.viewpager2.widget.ScrollEventAdapter.dispatchScrolled(ScrollEventAdapter.java:438) at androidx.viewpager2.widget.ScrollEventAdapter.onScrollStateChanged(ScrollEventAdapter.java:134) at androidx.recyclerview.widget.RecyclerView.dispatchOnScrollStateChanged(RecyclerView.java:5210) at androidx.recyclerview.widget.RecyclerView.setScrollState(RecyclerView.java:1550) at androidx.recyclerview.widget.RecyclerView.stopScroll(RecyclerView.java:2493) at androidx.recyclerview.widget.RecyclerView.onDetachedFromWindow(RecyclerView.java:2998) at android.view.View.dispatchDetachedFromWindow(View.java:14598) at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3074) at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3066) at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3066) at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3066) at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3066) at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3066) at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3066) at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3066) at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3066) at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3066) at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3066) at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3066) at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3066) at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3066) at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3066) at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3066) at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3066) at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3066) at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3066) at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3066) at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3066) at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3066) at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3066) at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3066) at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3066) at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3066) at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3066) at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3066) at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3066) at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3066) at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3066) at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3066) at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3066) at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3066) at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3066) at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3066) at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3066) at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3066) at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3066) at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3066) at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3066) at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3066) at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3066) at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3066) at android.view.ViewGroup.removeViewInternal(ViewGroup.java:4606) at android.view.ViewGroup.removeViewInternal(ViewGroup.java:4579) at android.view.ViewGroup.removeView(ViewGroup.java:4510) at com.swmansion.rnscreens.ScreenContainer.removeView(ScreenContainer.kt:66) at androidx.fragment.app.SpecialEffectsController$Operation$State.applyState(SpecialEffectsController.java:452) at androidx.fragment.app.DefaultSpecialEffectsController.applyContainerChanges(DefaultSpecialEffectsController.java:743) at androidx.fragment.app.DefaultSpecialEffectsController$1.run(DefaultSpecialEffectsController.java:108) at androidx.fragment.app.SpecialEffectsController$Operation.complete(SpecialEffectsController.java:695) at androidx.fragment.app.SpecialEffectsController$FragmentStateManagerOperation.complete(SpecialEffectsController.java:744) at androidx.fragment.app.SpecialEffectsController$Operation.completeSpecialEffect(SpecialEffectsController.java:672) at androidx.fragment.app.DefaultSpecialEffectsController$SpecialEffectsInfo.completeSpecialEffect(DefaultSpecialEffectsController.java:776) at androidx.fragment.app.DefaultSpecialEffectsController.startAnimations(DefaultSpecialEffectsController.java:147) at androidx.fragment.app.DefaultSpecialEffectsController.executeOperations(DefaultSpecialEffectsController.java:120) at androidx.fragment.app.SpecialEffectsController.executePendingOperations(SpecialEffectsController.java:297) at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:2202) at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:2106) at androidx.fragment.app.FragmentManager.execSingleAction(FragmentManager.java:1971) at androidx.fragment.app.BackStackRecord.commitNowAllowingStateLoss(BackStackRecord.java:311) at com.swmansion.rnscreens.ScreenContainer.onUpdate(ScreenContainer.kt:366) at com.swmansion.rnscreens.ScreenContainer.performUpdates(ScreenContainer.kt:311) at com.swmansion.rnscreens.ScreenContainer.performUpdatesNow(ScreenContainer.kt:303) at com.swmansion.rnscreens.ScreenContainer.notifyChildUpdate(ScreenContainer.kt:87) at com.swmansion.rnscreens.Screen.setActivityState(Screen.kt:132) at com.swmansion.rnscreens.ScreenViewManager.setActivityState(ScreenViewManager.kt:47) at com.swmansion.rnscreens.ScreenViewManager.setActivityState(ScreenViewManager.kt:34) at com.swmansion.rnscreens.ScreenViewManager.setActivityState(ScreenViewManager.kt:21) at com.facebook.react.viewmanagers.RNSScreenManagerDelegate.setProperty(RNSScreenManagerDelegate.java:81) at com.facebook.react.uimanager.ViewManagerPropertyUpdater.updateProps(ViewManagerPropertyUpdater.java:46) at com.facebook.react.uimanager.ViewManager.updateProperties(ViewManager.java:84) at com.facebook.react.uimanager.NativeViewHierarchyManager.updateProperties(NativeViewHierarchyManager.java:142) at com.facebook.react.uimanager.UIImplementation.synchronouslyUpdateViewOnUIThread(UIImplementation.java:306) at com.facebook.react.uimanager.UIManagerModule.synchronouslyUpdateViewOnUIThread(UIManagerModule.java:402) at com.facebook.react.animated.PropsAnimatedNode.updateView(PropsAnimatedNode.java:118) at com.facebook.react.animated.NativeAnimatedNodesManager.updateNodes(NativeAnimatedNodesManager.java:747) at com.facebook.react.animated.NativeAnimatedNodesManager.runUpdates(NativeAnimatedNodesManager.java:641) at com.facebook.react.animated.NativeAnimatedModule$1.doFrameGuarded(NativeAnimatedModule.java:263) at com.facebook.react.uimanager.GuardedFrameCallback.doFrame(GuardedFrameCallback.java:29) at com.facebook.react.modules.core.ReactChoreographer$ReactChoreographerDispatcher.doFrame(ReactChoreographer.java:175) at com.facebook.react.modules.core.ChoreographerCompat$FrameCallback$1.doFrame(ChoreographerCompat.java:85) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:858) at android.view.Choreographer.doCallbacks(Choreographer.java:672) at android.view.Choreographer.doFrame(Choreographer.java:605) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:846) at android.os.Handler.handleCallback(Handler.java:742) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:157) at android.app.ActivityThread.main(ActivityThread.java:5603) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:774) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:652)

milkmouth commented 1 year ago

@rifad4u Did you solve it?

yevheniionipko commented 1 year ago

Have same problem

"react-native": "0.70.6",
"react-native-screens": "^3.18.2",
"@react-navigation/bottom-tabs": "^6.5.0",
"@react-navigation/native": "^6.1.1",
"@react-navigation/native-stack": "^6.9.7",
"@react-navigation/stack": "^6.3.8",

@kkafar did you resolve it?

kkafar commented 1 year ago

Would you mind providing reproduction of your case?

rawb-levit commented 1 year ago

@kkafar Hello, I have same problem like above cases.

It appears after 3~5seconds app launching, especially high possible on android 10.

package.json

    "@react-navigation/bottom-tabs": "^6.5.3",
    "@react-navigation/material-top-tabs": "^6.5.2",
    "@react-navigation/native": "^6.1.2",
    "@react-navigation/stack": "^6.3.11",
    "react": "18.1.0",
    "react-native": "0.70.6",
    "react-native-gesture-handler": "^2.9.0",
    "react-native-pager-view": "^6.1.2",
    "react-native-raw-bottom-sheet": "^2.2.0",
    "react-native-safe-area-context": "^4.4.1",
    "react-native-screens": "^3.18.2",
    "react-native-tab-view": "^3.3.4",
    "react-native-webview": "^11.26.0"

app/build.gradle:

... 
project.ext.react = [
    enableHermes: true,  // clean and rebuild if changing
]

apply from: "../../node_modules/react-native/react.gradle"
...

Firebase Crashlytics Log:

# Crashlytics - Stack trace
# Application: ****
# Platform: android
# Version: 2.1.0 (1019)
# Issue: 8b973e878b44209469083970ecc0432a
# Session: 63CE158C026C00012DAF0E8276C4D725_DNE_0_v2
# Date: Mon Jan 23 2023 17:04:33 GMT+0900 (한국 표준시)

Fatal Exception: java.lang.RuntimeException: java.lang.IllegalStateException: FragmentManager is already executing transactions
       at com.facebook.react.animated.NativeAnimatedModule$1.doFrameGuarded(NativeAnimatedModule.java:279)
       at com.facebook.react.uimanager.GuardedFrameCallback.doFrame(GuardedFrameCallback.java:29)
       at com.facebook.react.modules.core.ReactChoreographer$ReactChoreographerDispatcher.doFrame(ReactChoreographer.java:175)
       at com.facebook.react.modules.core.ChoreographerCompat$FrameCallback$1.doFrame(ChoreographerCompat.java:85)
       at android.view.Choreographer$CallbackRecord.run(Choreographer.java:997)
       at android.view.Choreographer.doCallbacks(Choreographer.java:797)
       at android.view.Choreographer.doFrame(Choreographer.java:728)
       at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:984)
       at android.os.Handler.handleCallback(Handler.java:883)
       at android.os.Handler.dispatchMessage(Handler.java:100)
       at android.os.Looper.loop(Looper.java:237)
       at android.app.ActivityThread.main(ActivityThread.java:8167)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:496)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1100)

Caused by java.lang.IllegalStateException: FragmentManager is already executing transactions
       at androidx.fragment.app.FragmentManager.ensureExecReady(FragmentManager.java:1931)
       at androidx.fragment.app.FragmentManager.execSingleAction(FragmentManager.java:1967)
       at androidx.fragment.app.BackStackRecord.commitNowAllowingStateLoss(BackStackRecord.java:311)
       at com.swmansion.rnscreens.ScreenContainer.onUpdate(ScreenContainer.kt:366)
       at com.swmansion.rnscreens.ScreenContainer.performUpdates(ScreenContainer.kt:311)
       at com.swmansion.rnscreens.ScreenContainer.performUpdatesNow(ScreenContainer.kt:303)
       at com.swmansion.rnscreens.ScreenContainer.notifyChildUpdate(ScreenContainer.kt:87)
       at com.swmansion.rnscreens.Screen.setActivityState(Screen.kt:132)
       at com.swmansion.rnscreens.ScreenViewManager.setActivityState(ScreenViewManager.kt:49)
       at com.swmansion.rnscreens.ScreenViewManager.setActivityState(ScreenViewManager.kt:34)
       at com.swmansion.rnscreens.ScreenViewManager.setActivityState(ScreenViewManager.kt:21)
       at com.facebook.react.viewmanagers.RNSScreenManagerDelegate.setProperty(RNSScreenManagerDelegate.java:81)
       at com.facebook.react.uimanager.ViewManagerPropertyUpdater.updateProps(ViewManagerPropertyUpdater.java:46)
       at com.facebook.react.uimanager.ViewManager.updateProperties(ViewManager.java:84)
       at com.facebook.react.uimanager.NativeViewHierarchyManager.updateProperties(NativeViewHierarchyManager.java:142)
       at com.facebook.react.uimanager.UIImplementation.synchronouslyUpdateViewOnUIThread(UIImplementation.java:306)
       at com.facebook.react.uimanager.UIManagerModule.synchronouslyUpdateViewOnUIThread(UIManagerModule.java:402)
       at com.facebook.react.animated.PropsAnimatedNode.updateView(PropsAnimatedNode.java:118)
       at com.facebook.react.animated.NativeAnimatedNodesManager.updateNodes(NativeAnimatedNodesManager.java:747)
       at com.facebook.react.animated.NativeAnimatedNodesManager.handleEvent(NativeAnimatedNodesManager.java:600)
       at com.facebook.react.animated.NativeAnimatedNodesManager.onEventDispatch(NativeAnimatedNodesManager.java:562)
       at com.facebook.react.uimanager.events.EventDispatcherImpl.dispatchEvent(EventDispatcherImpl.java:116)
       at com.reactnativepagerview.PagerViewViewManager$createViewInstance$1$1.onPageScrolled(PagerViewViewManager.kt:43)
       at androidx.viewpager2.widget.CompositeOnPageChangeCallback.onPageScrolled(CompositeOnPageChangeCallback.java:59)
       at androidx.viewpager2.widget.CompositeOnPageChangeCallback.onPageScrolled(CompositeOnPageChangeCallback.java:59)
       at androidx.viewpager2.widget.ScrollEventAdapter.dispatchScrolled(ScrollEventAdapter.java:438)
       at androidx.viewpager2.widget.ScrollEventAdapter.onScrollStateChanged(ScrollEventAdapter.java:134)
       at androidx.recyclerview.widget.RecyclerView.dispatchOnScrollStateChanged(RecyclerView.java:5210)
       at androidx.recyclerview.widget.RecyclerView.setScrollState(RecyclerView.java:1550)
       at androidx.recyclerview.widget.RecyclerView.stopScroll(RecyclerView.java:2493)
       at androidx.recyclerview.widget.RecyclerView.onDetachedFromWindow(RecyclerView.java:2998)
       at android.view.View.dispatchDetachedFromWindow(View.java:21358)
       at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:4649)
       at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:4641)
       at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:4641)
       at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:4641)
       at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:4641)
       at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:4641)
       at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:4641)
       at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:4641)
       at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:4641)
       at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:4641)
       at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:4641)
       at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:4641)
       at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:4641)
       at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:4641)
       at android.view.ViewGroup.removeViewInternal(ViewGroup.java:6287)
       at android.view.ViewGroup.removeViewInternal(ViewGroup.java:6258)
       at android.view.ViewGroup.removeView(ViewGroup.java:6189)
       at com.swmansion.rnscreens.ScreenContainer.removeView(ScreenContainer.kt:66)
       at androidx.fragment.app.SpecialEffectsController$Operation$State.applyState(SpecialEffectsController.java:452)
       at androidx.fragment.app.DefaultSpecialEffectsController.applyContainerChanges(DefaultSpecialEffectsController.java:743)
       at androidx.fragment.app.DefaultSpecialEffectsController$1.run(DefaultSpecialEffectsController.java:108)
       at androidx.fragment.app.SpecialEffectsController$Operation.complete(SpecialEffectsController.java:695)
       at androidx.fragment.app.SpecialEffectsController$FragmentStateManagerOperation.complete(SpecialEffectsController.java:744)
       at androidx.fragment.app.SpecialEffectsController$Operation.completeSpecialEffect(SpecialEffectsController.java:672)
       at androidx.fragment.app.DefaultSpecialEffectsController$SpecialEffectsInfo.completeSpecialEffect(DefaultSpecialEffectsController.java:776)
       at androidx.fragment.app.DefaultSpecialEffectsController.startAnimations(DefaultSpecialEffectsController.java:147)
       at androidx.fragment.app.DefaultSpecialEffectsController.executeOperations(DefaultSpecialEffectsController.java:120)
       at androidx.fragment.app.SpecialEffectsController.executePendingOperations(SpecialEffectsController.java:297)
       at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:2202)
       at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:2106)
       at androidx.fragment.app.FragmentManager.execSingleAction(FragmentManager.java:1971)
       at androidx.fragment.app.BackStackRecord.commitNowAllowingStateLoss(BackStackRecord.java:311)
       at com.swmansion.rnscreens.ScreenContainer.onUpdate(ScreenContainer.kt:366)
       at com.swmansion.rnscreens.ScreenContainer.performUpdates(ScreenContainer.kt:311)
       at com.swmansion.rnscreens.ScreenContainer.performUpdatesNow(ScreenContainer.kt:303)
       at com.swmansion.rnscreens.ScreenContainer.notifyChildUpdate(ScreenContainer.kt:87)
       at com.swmansion.rnscreens.Screen.setActivityState(Screen.kt:132)
       at com.swmansion.rnscreens.ScreenViewManager.setActivityState(ScreenViewManager.kt:47)
       at com.swmansion.rnscreens.ScreenViewManager.setActivityState(ScreenViewManager.kt:34)
       at com.swmansion.rnscreens.ScreenViewManager.setActivityState(ScreenViewManager.kt:21)
       at com.facebook.react.viewmanagers.RNSScreenManagerDelegate.setProperty(RNSScreenManagerDelegate.java:81)
       at com.facebook.react.uimanager.ViewManagerPropertyUpdater.updateProps(ViewManagerPropertyUpdater.java:46)
       at com.facebook.react.uimanager.ViewManager.updateProperties(ViewManager.java:84)
       at com.facebook.react.uimanager.NativeViewHierarchyManager.updateProperties(NativeViewHierarchyManager.java:142)
       at com.facebook.react.uimanager.UIImplementation.synchronouslyUpdateViewOnUIThread(UIImplementation.java:306)
       at com.facebook.react.uimanager.UIManagerModule.synchronouslyUpdateViewOnUIThread(UIManagerModule.java:402)
       at com.facebook.react.animated.PropsAnimatedNode.updateView(PropsAnimatedNode.java:118)
       at com.facebook.react.animated.NativeAnimatedNodesManager.updateNodes(NativeAnimatedNodesManager.java:747)
       at com.facebook.react.animated.NativeAnimatedNodesManager.runUpdates(NativeAnimatedNodesManager.java:641)
       at com.facebook.react.animated.NativeAnimatedModule$1.doFrameGuarded(NativeAnimatedModule.java:263)
       at com.facebook.react.uimanager.GuardedFrameCallback.doFrame(GuardedFrameCallback.java:29)
       at com.facebook.react.modules.core.ReactChoreographer$ReactChoreographerDispatcher.doFrame(ReactChoreographer.java:175)
       at com.facebook.react.modules.core.ChoreographerCompat$FrameCallback$1.doFrame(ChoreographerCompat.java:85)
       at android.view.Choreographer$CallbackRecord.run(Choreographer.java:997)
       at android.view.Choreographer.doCallbacks(Choreographer.java:797)
       at android.view.Choreographer.doFrame(Choreographer.java:728)
       at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:984)
       at android.os.Handler.handleCallback(Handler.java:883)
       at android.os.Handler.dispatchMessage(Handler.java:100)
       at android.os.Looper.loop(Looper.java:237)
       at android.app.ActivityThread.main(ActivityThread.java:8167)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:496)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1100)
yevheniionipko commented 1 year ago

@kkafar

Fatal Exception: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.dummy/com.dummy.MainActivity}: androidx.fragment.app.Fragment$InstantiationException: Unable to instantiate fragment com.swmansion.rnscreens.ScreenStackFragment: calling Fragment constructor caused an exception at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:4035) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:4201) at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:103) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2438) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loopOnce(Looper.java:226) at android.os.Looper.loop(Looper.java:313) at android.app.ActivityThread.main(ActivityThread.java:8663) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:567) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1135) Caused by androidx.fragment.app.Fragment$InstantiationException: Unable to instantiate fragment com.swmansion.rnscreens.ScreenStackFragment: calling Fragment constructor caused an exception at androidx.fragment.app.Fragment.instantiate(Fragment.java:631) at androidx.fragment.app.FragmentContainer.instantiate(FragmentContainer.java:57) at androidx.fragment.app.FragmentManager$3.instantiate(FragmentManager.java:483) at androidx.fragment.app.FragmentStateManager.<init>(FragmentStateManager.java:85) at androidx.fragment.app.FragmentManager.restoreSaveState(FragmentManager.java:2728) at androidx.fragment.app.FragmentController.restoreSaveState(FragmentController.java:198) at androidx.fragment.app.FragmentActivity$2.onContextAvailable(FragmentActivity.java:149) at androidx.activity.contextaware.ContextAwareHelper.dispatchOnContextAvailable(ContextAwareHelper.java:99) at androidx.activity.ComponentActivity.onCreate(ComponentActivity.java:313) at androidx.fragment.app.FragmentActivity.onCreate(FragmentActivity.java:273) at com.facebook.react.ReactActivity.onCreate(ReactActivity.java:45) at com.kyivstar.mykyivstar.MainActivity.onCreate(MainActivity.java:69) at android.app.Activity.performCreate(Activity.java:8290) at android.app.Activity.performCreate(Activity.java:8270) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1329) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:4009) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:4201) at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:103) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2438) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loopOnce(Looper.java:226) at android.os.Looper.loop(Looper.java:313) at android.app.ActivityThread.main(ActivityThread.java:8663) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:567) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1135)

Знімок екрана 2023-01-23 о 11 00 05
vshy108 commented 1 year ago

In my case, I have react-native-screens 3.20, A custom Android UI Fragment is placed under Stack created via @react-navigation/native-stack 6.9.12 under NavigationContainer of @react-navigation/native 6.1.6

When I tried to debug why my mobile app cannot render screen contains custom Android Fragment if navigate from general screen (but it is okay to render it if I set it as initial route)

It throws error in androidx/fragment/app/FragmentStateManager.java when createView()

            container = (ViewGroup) fragmentContainer.onFindViewById(mFragment.mContainerId);
            if (container == null && !mFragment.mRestored) {
                String resName;
                try {
                    resName = mFragment.getResources().getResourceName(mFragment.mContainerId);
                } catch (Resources.NotFoundException e) {
                    resName = "unknown";
                }
                throw new IllegalArgumentException("No view found for id 0x"
                        + Integer.toHexString(mFragment.mContainerId) + " ("
                        + resName + ") for fragment " + mFragment);
            }

and I also suspect onDetachedFromWindow of ScreenContainer.kt

removeMyFragments(it)
 it.executePendingTransactions()

When the stack screen has custom Android Fragment, it will trigger this error. I tried to avoid the fragment being removed from container, but I failed. Hence my direction went to avoid the screen being detected has custom Android UI component. I solved my problem via dynamic import by React lazy in that screen and before leaving the screen, create a function to trigger onStop() of the fragment and remove the fragment after that in ViewManager of the custom Android UI component.

exotexot commented 1 year ago

I have the same issue, using rn-screens 3.20 and react native 0.71.x

I'm navigating to a new screen with a custom Android UI and I get this crash. It seems like some race condition or blocked resources which lead to that crash. Havent had this issue with previous versions...

I don't know how to fix this. Please help.

MahmoudMohamed960 commented 1 year ago

hello this issue still happened on react-native-screens:3.24 version , i tried the solution of put this line "react-native-screens": "software-mansion/react-native-screens#main" on package.json but still didn`t work how can i fix it ?

MahmoudMohamed960 commented 1 year ago

I don't know how to fix this. Please help.

I have the same issue, using rn-screens 3.20 and react native 0.71.x

I'm navigating to a new screen with a custom Android UI and I get this crash. It seems like some race condition or blocked resources which lead to that crash. Havent had this issue with previous versions...

I don't know how to fix this. Please help.

solved or not ?

rifad4u commented 1 year ago

I have the same issue, using rn-screens 3.20 and react native 0.71.x

I'm navigating to a new screen with a custom Android UI and I get this crash. It seems like some race condition or blocked resources which lead to that crash. Havent had this issue with previous versions...

I don't know how to fix this. Please help.

If you are able to reproduce the issue, the share a reproducible repo for the same, react native will look in to it.

MahmoudMohamed960 commented 1 year ago

I have the same issue, using rn-screens 3.20 and react native 0.71.x I'm navigating to a new screen with a custom Android UI and I get this crash. It seems like some race condition or blocked resources which lead to that crash. Havent had this issue with previous versions... I don't know how to fix this. Please help.

If you are able to reproduce the issue, the share a reproducible repo for the same, react native will look in to it.

you can see this rep : https://github.com/MahmoudMohamed960/ArcGisPoc.git

TuurDutoit commented 11 months ago

We're seeing this issue too in production: so far, we've seen 2 crashes, both on Android 13. 2 different Samsung devices.

Stack trace (truncated - I can provide the full one if useful):

Exception java.lang.RuntimeException: java.lang.IllegalStateException: FragmentManager is already executing transactions
  at com.facebook.react.animated.NativeAnimatedModule$1.doFrameGuarded (NativeAnimatedModule.java:279)
  at com.facebook.react.uimanager.GuardedFrameCallback.doFrame (GuardedFrameCallback.java:29)
  at com.facebook.react.modules.core.ReactChoreographer$ReactChoreographerDispatcher.doFrame (ReactChoreographer.java:175)
  at com.facebook.react.modules.core.ChoreographerCompat$FrameCallback$1.doFrame (ChoreographerCompat.java)
  at android.view.Choreographer$CallbackRecord.run (Choreographer.java:1299)
  at android.view.Choreographer$CallbackRecord.run (Choreographer.java:1309)
  at android.view.Choreographer.doCallbacks (Choreographer.java:923)
  at android.view.Choreographer.doFrame (Choreographer.java:847)
  at android.view.Choreographer$FrameDisplayEventReceiver.run (Choreographer.java:1283)
  at android.os.Handler.handleCallback (Handler.java:942)
  at android.os.Handler.dispatchMessage (Handler.java:99)
  at android.os.Looper.loopOnce (Looper.java:226)
  at android.os.Looper.loop (Looper.java:313)
  at android.app.ActivityThread.main (ActivityThread.java:8762)
  at java.lang.reflect.Method.invoke
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:604)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1067)
Caused by java.lang.IllegalStateException: FragmentManager is already executing transactions
  at androidx.fragment.app.FragmentManager.ensureExecReady (FragmentManager.java:1636)
  at androidx.fragment.app.FragmentManager.execSingleAction (FragmentManager.java:1666)
  at androidx.fragment.app.BackStackRecord.commitNowAllowingStateLoss (BackStackRecord.java:323)
  at com.swmansion.rnscreens.ScreenContainer.onUpdate (ScreenContainer.kt:366)
  at com.swmansion.rnscreens.ScreenContainer.performUpdates (ScreenContainer.kt:311)
  at com.swmansion.rnscreens.ScreenContainer.performUpdatesNow (ScreenContainer.kt:303)
  at com.swmansion.rnscreens.ScreenContainer.notifyChildUpdate (ScreenContainer.kt)
  at com.swmansion.rnscreens.Screen.setActivityState (Screen.kt:132)
  at com.swmansion.rnscreens.ScreenViewManager.setActivityState (ScreenViewManager.kt:49)
  at com.swmansion.rnscreens.ScreenViewManager.setActivityState (ScreenViewManager.kt:34)
  at com.swmansion.rnscreens.ScreenViewManager.setActivityState (ScreenViewManager.kt:21)
  at com.facebook.react.viewmanagers.RNSScreenManagerDelegate.setProperty (RNSScreenManagerDelegate.java:96)

We also have a report in Sentry, which contains some interesting details in the breadcrumbs:

TuurDutoit commented 11 months ago

We're up to 11 crashes today, now also from other manufacturers. Only some reports mention the memory warning, many of them don't. The crash always happens at the same point (going back from 1 specific screen in our app to another specific screen), but we haven't been able to reproduce the issue ourselves.

kkafar commented 11 months ago

@TuurDutoit,

do you have any custom UI fragments, also could you give me an overview of how your navigation stack is structured (are there nested stacks, where are these two screens in relation to whole navigation structure, is this brownfield app? (React native loaded on a Fragment / only in subpart of view hierarchy)?

TuurDutoit commented 11 months ago

Our whole app is React Native, not brownfield, and we don't have any custom UI elements (except for what our dependencies may be doing, of course - nothing we wrote ourselves, at least). While it's a fairly large app, we use a pretty standard setup, nothing custom.

Our navigation structure looks like this:

The crash happens when we RESET the navigation from the CAMPUS_VIDEO_EXERCISE_MAIN_SCREEN to the DASHBOARD_SCREEN. The CAMPUS_VIDEO_EXERCISE_MAIN_SCREEN is fairly simple: it basically renders a WebView and some buttons The DASHBOARD_SCREEN is a lot more complex, with scrollviews in both directions, images, potentially a Modal, etc.

Main dependencies:

Also note this issue started happening after upgrading react-navigation from v4 to v6, which also updated react-native-screens from 2.16.1 to 3.22.0

kmonty12 commented 11 months ago

Has anybody been able to solve this? Currently experiencing the same issue with our android application. Running react-native-screens 3.25.0

tboba commented 11 months ago

Hi @kmonty12, could you answer the same questions that @kkafar has asked above? Are you performing similar instructions that are described in steps to reproduce in the description of this issue? Just wanted to know if they still works 🤔

KestasVenslauskas commented 10 months ago

Having same issue for a while now. App is pure react-native.

"@react-navigation/native": "^6.1.9", "react-native-screens": "3.29.0",

My project is open source and here is the navigation: https://github.com/lrtlt/mobile/blob/master/app/navigation/MainStack.tsx

kmonty12 commented 10 months ago

@tboba Our application is purely react native & has no custom UI fragments. We do have a few nested stack navigators that is very similar to what @TuurDutoit shared. We've seen 235 total events including the fragment error issue after updating to the newest versions of react native & react-navigation (stack, native & bottom-tabs) 1 month ago. Does anybody have a fix for this? Looking at switching navigators to avoid this error.