Crash on Android with react-navigation stack
See original GitHub issueWhen I navigate to this specific screen the app is crashing.
It works fine on iOS and it works fine if I comment out enableScreens()
and not use react-native-screens
It’s a pretty standard screen, apollo hooks + SectionList
and some Text
View
TouchableOpacity
(from react-native-gesture-handler
)
Here is the log collected by Sentry, is there anything I can do to debug and help finding the root cause?
java.lang.IllegalStateException: Fragment already added: ScreenFragment{e9e00a9 (89d81b03-c200-4966-881c-38bb9e88da42) id=0x175}
at androidx.fragment.app.FragmentManagerImpl.addFragment(FragmentManagerImpl.java:1379)
at androidx.fragment.app.BackStackRecord.executeOps(BackStackRecord.java:399)
at androidx.fragment.app.FragmentManagerImpl.executeOps(FragmentManagerImpl.java:2079)
at androidx.fragment.app.FragmentManagerImpl.executeOpsTogether(FragmentManagerImpl.java:1869)
at androidx.fragment.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManagerImpl.java:1830)
at androidx.fragment.app.FragmentManagerImpl.execPendingActions(FragmentManagerImpl.java:1727)
at androidx.fragment.app.FragmentManagerImpl$2.run(FragmentManagerImpl.java:150)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
Issue Analytics
- State:
- Created 4 years ago
- Reactions:17
- Comments:28 (9 by maintainers)
Top Results From Across the Web
App crashes while navigating (Android Only) #10290 - GitHub
Current behavior After upgrading navigation v6 from v5, sometimes app crashing while animating. I investigated this a lot, and i think its ...
Read more >How to avoid having createStackNavigator crash react-native ...
So the navigation.navigate in the docs isnt working but when you change that to push it works. However, it just pushes another screen...
Read more >Crash when used with react-navigation
The YoutubePlayer causes a crash immediately on navigating to another screen, and also sometimes when navigating to the screen that contains the component....
Read more >Stack Navigator | React Navigation
Stack Navigator provides a way for your app to transition between screens where each new screen is placed on top of a stack....
Read more >react-native-screens v3.18.0 - npm.io
To take advantage of the native stack navigator primitive for React Navigation that leverages UINavigationController on iOS and Fragment on Android, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Same issue with react-navigation v5 and react-native-screens v2.0.0-beta.2 Happens when going back to previous screen
Quick workaround for production if necessary: what helped us was actually removing
useScreens
method while using android platform for now.