[SDK 52] Crash on Android when using presentation: 'formSheet' and switching apps #2627
Labels
Platform: Android
This issue is specific to Android
Repro provided
A reproduction with a snack or repo is provided
Description
I encountered an issue in Expo SDK 52 while using the presentation: 'formSheet' option in a stack screen. It works perfectly fine on both iOS and Android, except on Android when you:
Open the formSheet.
Switch to another app or access the task manager (e.g., swipe up to view all running apps) while the sheet is opened.
Return to the app.
The app crashes with the following error:
This issue occurs in Expo Go, development builds, and release builds, meaning it's not just a development-related bug.
In Expo Go, the error message is not descriptive—making debugging difficult.
In a development or release build, the crash logs indicate:
java.lang.IllegalStateException: Fragment already added: ScreenStackFragment{f1ecdea}
Steps to reproduce
Snack or a link to a repository
https://github.com/qretsar/screens-reproduction
Screens version
4.4.0
React Native version
0.76.6
Platforms
Android
JavaScript runtime
None
Workflow
None
Architecture
None
Build type
None
Device
None
Device model
Xiaomi 12 (Android 12), Emulator, and others
Acknowledgements
Yes
The text was updated successfully, but these errors were encountered: