react-native-screens: NullPointerException - LifecycleRegistry.removeObserver
Description
We’re getting a few NPE in our app in prod.
NullPointerException
Parameter specified as non-null is null: method androidx.lifecycle.LifecycleRegistry.removeObserver, parameter observer
Searching for removeObserver
in our entire project returns only this line in react-native-screens
:
https://github.com/software-mansion/react-native-screens/blob/6272e448afce5a112d1ddffc3cc146a453738be5/android/src/main/java/com/swmansion/rnscreens/LifecycleHelper.kt#L46
Steps to reproduce
We can’t seem to reproduce. It seems to be happening only on Android. Maybe on app start (we don’t see any breadcrumbs in Sentry).
Snack or a link to a repository
Couldn’t repro in snack.
Screens version
3.18.2
React Native version
0.71.8
Platforms
Android
JavaScript runtime
Hermes
Workflow
React Native (without Expo)
Architecture
Paper (Old Architecture)
Build type
Release mode
Device
Real device
Device model
Redmi Note 9 Pro Max - Android 11
Acknowledgements
Yes
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 22
Here’s the patch:
That was my plan for the patch
We can’t even repro in our own app. It seems to be happening intermittently for some users only.