FragmentManager has been destroyed
See original GitHub issueDescription
I can’t reproduce it, but it happened 1000 times in the last month in production. (Sentry and Google Console crash report)
This is the stack trace:
java.lang.IllegalStateException: FragmentManager has been destroyed at androidx.fragment.app.l.a at androidx.fragment.app.l.a at com.swmansion.rnscreens.g.onDetachedFromWindow at android.view.View.dispatchDetachedFromWindow(View.java:18679) at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3886) at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3878) at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3878) at android.view.ViewGroup.removeAllViewsInLayout(ViewGroup.java:5640) at android.view.ViewGroup.removeAllViews(ViewGroup.java:5586) at com.swmansion.rnscreens.d.onDetachedFromWindow at android.view.View.dispatchDetachedFromWindow(View.java:18679) at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3886) at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3878) at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3878) at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3878) at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3878) at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3878) at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3878) at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3878) at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3878) at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3878) at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3878) at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3878) at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3878) at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3878) at android.view.ViewGroup.removeViewInternal(ViewGroup.java:5432) at android.view.ViewGroup.removeViewInternal(ViewGroup.java:5403) at android.view.ViewGroup.removeView(ViewGroup.java:5334) at com.swmansion.rnscreens.d.removeView at androidx.fragment.app.l.a at androidx.fragment.app.l.j at androidx.fragment.app.l.i at androidx.fragment.app.l.a at androidx.fragment.app.l.b at androidx.fragment.app.l.c at androidx.fragment.app.l.c at androidx.fragment.app.l$d.run at android.os.Handler.handleCallback(Handler.java:789) at android.os.Handler.dispatchMessage(Handler.java:98) at android.os.Looper.loop(Looper.java:164) at android.app.ActivityThread.main(ActivityThread.java:6944) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
Screenshots
Steps To Reproduce
Can’t reproduce it, tried to kill activity and all that but didn’t reproduce… (I did put the onCreate(null) )
Snack or minimal code example
I’m using a nested navigator
The HomeStack is the native
function HomeNavigator() {
return (
<HomeStack.Navigator screenOptions={{ headerShown: false }}>
<HomeStack.Screen
options={{
animationEnabled: false,
stackAnimation: 'none',
}}
name={"Test"}
component={TestScreen}
/>
<HomeStack.Screen
options={{
animationEnabled: false,
stackAnimation: 'none',
drawerLockMode: 'locked-closed',
}}
name="Test2"
component={Test2}
/>
</HomeStack.Navigator>
);
}
function DrawerNavigator({ currentScreen }) {
return (
<Drawer.Navigator
drawerType="slide"
backBehavior="none"
drawerContent={props => {
return <DrawerContent {...props} />;
}}
>
<Drawer.Screen
name={"Home"}
component={HomeNavigator}
/>
</Drawer.Navigator>
);
}
Package versions
Issue Analytics
- State:
- Created 3 years ago
- Reactions:3
- Comments:10 (4 by maintainers)
Top GitHub Comments
thanks, I’ll patch-package the change, submit it in our next release and let you know of the results.
Tengo un error al intentar llamar un fragment por segunda vez, por favor ayudenme