react-native-screens: Expected receiver of type com.swmansion.rnscreens.ScreenFragment, but got com.facebook.react.modules.dialog.AlertFragment

Description

i am using react-native-screens, react-navigation in my app. this happens intermittently when using system alerts.

sentry error

IllegalArgumentException
Expected receiver of type com.swmansion.rnscreens.ScreenFragment, but got com.facebook.react.modules.dialog.AlertFragment

Steps to reproduce

  1. Run the screen in a react-navigation environment.
  2. use Alert.alert() in android.
  3. intermittently crashed.

Snack or a link to a repository

Private Repository

Screens version

3.30.1 -> 3.34.0

React Native version

0.73.9

Platforms

Android

JavaScript runtime

Hermes

Workflow

React Native (without Expo)

Architecture

Paper (Old Architecture)

Build type

Release mode

Device

None

Device model

SM-S918N

Acknowledgements

Yes

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 16 (4 by maintainers)

Most upvoted comments

@bartlomiejbloniarz @kkafar @alduzy We have confirmed that this issue has been resolved in react-native-reanimated 3.14 version. No problem. We will close this issue.

Thank you.

@ukcasso Actually this issue also seems to have been resolved in the newest reanimated version as per this PR. So the version update should help!

@ukcasso @kkafar It seems that the reported issue happens on the old architecture. The tab navigator bug that was fixed in 3.14 was on the new architecture, so this probably won’t help. I think this might be tied to Shared Element Transitions. I will try to investigate it further.

@kkafar I will probably distribute it after updating the reanimated library next week. I’ll let you know how it goes. thank you

Glad to hear that @ukcasso. Absolutely let us know whether bumping reanimated version resolved the issue or we need to put time in debugging here