react-native-bootsplash: Crash: Attempt to invoke direct method 'void android.view.SurfaceControl.checkNotReleased()'
Bug summary
This crash occurs when a Pixel user backgrounds the application before the splashscreen finishes & the hide method can be invoked.
Initially I filed a crash report w/ Google but their response suggests this can be avoided on v12 by perhaps trying to unregister setOnExitAnimationListener, as well as stop any other Splash screen animation/logic - possibly when the activity onPause is invoked?
Crash report: https://issuetracker.google.com/issues/242118185?pli=1
This is likely occurring near this line https://github.com/zoontek/react-native-bootsplash/blob/master/android/src/main/java/com/zoontek/rnbootsplash/RNBootSplashModule.java#L124
Library version
4.3.1
Environment info
SDKs:
iOS SDK:
Platforms: DriverKit 21.4, iOS 15.5, macOS 12.3, tvOS 15.4, watchOS 8.5
Android SDK:
API Levels: 28, 29, 30, 31, 32
Build Tools: 29.0.2, 29.0.3, 30.0.2, 30.0.3, 31.0.0, 33.0.0
System Images: android-30 | Google APIs Intel x86 Atom, android-30 | Google Play Intel x86 Atom
Android NDK: Not Found
IDEs:
Android Studio: 2021.1 AI-211.7628.21.2111.8309675
Xcode: 13.4.1/13F100 - /usr/bin/xcodebuild
Languages:
Java: 11.0.15 - /usr/bin/javac
Steps to reproduce
- Open an app with react-native-bootscreen
- Before the bootscreen completes, background the app
- Open the app back up and notice a crash
Reproducible sample code
Should be reproducible in sample app on a Google Pixel device.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 29
- Comments: 22 (4 by maintainers)
I investigated a bit, and can reproduce it.
The issue is kinda hard to solve since even if I implement a
LifecycleEventListener, callactivity.getSplashScreen().clearOnExitAnimationListener()on activity pause, it’s already too late:https://github.com/zoontek/react-native-bootsplash/assets/1902323/ec827aa6-84de-4541-8251-d091bb5ed202
The effect is what appears to be a restart of the UI, but it has no impact on the app itself.
same +1
Android 13 users facing this issue.
Facing the same issue in the 5.0 version also
Version 5.0.0 is available: https://github.com/zoontek/react-native-bootsplash/releases/tag/5.0.0
Could you please just upvote with emojis on the initial message instead of spamming?
No need to trigger notifications for everyone watching this thread just to say “Same”.
@LonelyCpp I would not recommend it, for a pretty good reason. The fix is here: https://github.com/zoontek/react-native-bootsplash/pull/475 😄
https://github.com/zoontek/react-native-bootsplash/assets/1902323/83db745e-8e47-4295-822e-933f99a4855e
We started seeing this crash as well after migrating from
react-native-splash-screentoreact-native-bootsplash:We’re facing the same issue on Android 13.
Same
I just removed this
setOnExitAnimationListenercall entirely because I don’t need fade out animation. Then, it seems to be fixed now.Same
same +1