-
Notifications
You must be signed in to change notification settings - Fork 605
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@capacitor/splash-screen: Calling SplashScreen.hide() in background on Android causes crash #1856
Comments
This issue needs more information before it can be addressed. Please see the Contributing Guide for how to create a Sample App. Thanks! |
Consider calling the |
It also happens with the SplashScreen: {
launchAutoHide: true,
launchShowDuration: 2000,
backgroundColor: "#F6F8F8",
androidScaleType: "CENTER_CROP",
splashFullScreen: true,
}, |
I tested the demo you provided on three different Android devices, and it performed well on all of them. To expedite the resolution of the issue you're encountering, it would be helpful if you could provide the Logcat log specific to the device where the problem occurs. This is especially important considering that not all development teams may have the OnePlus device for testing physical phones. |
This is an Android 12 OS bug that was supposedly fixed on Android 13, but for some reason some devices with Android 13 (mostly Oppo/Oneplus) are still affected. What The only thing I've found that makes the app to not crash is to not call So we can add a feature to allow users to prevent the |
in my react project: capacitor.config.json "plugins": {
"SplashScreen": {
"launchAutoHide": false
},
} App.tsx const timer = setTimeout(()=>{
SplashScreen.hide().catch((error) => console.error(error));
clearTimeout(timer);
},3000)
const App: React.FC = () => {
...
} I only use it to avoid errors caused by Splash.hide(). |
@jcesarmobile Hi, react-native-bootsplash maintainer here. The issue is caused by how they implement the way to keep the splash screen on screen. They basically freeze the UI updates during the whole time the splash screen is visible. Another thing you can try: Just after the splash screen is shown (with the AndroidX lib), try to lock the phone screen and unlock (put a timeout at 10s to hide the splash screen) 😅 |
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of the plugin, please create a new issue and ensure the template is fully filled out. |
Bug Report
Plugin(s)
@capacitor/splash-screen
Capacitor Version
Platform(s)
Android
Current Behavior
We've started seeing a couple of splash screen related crash reports in Firebase Crashlytics after a recent update to Capacitor 5.
Our investigation revealed it's related to the
@capacitor/splash-screen
package.The problem manifests itself when the app is backgrounded when the splash screen is still visible, and later the
hide
method is called in the background.Looking up the error message revealed the same issue was present in
react-native-bootsplash
package. You can see this issue for additional technical details and applied fix.Also it seems it's happening only for a specific subset of devices:
Stacktrace:
Expected Behavior
The app doesn't crash when splash screen
hide
method is called in the backgroundCode Reproduction
https://github.com/jmartycak-rbi/capacitor-splash-screen-bug
Steps to reproduce in readme
Other Technical Details
n/a
Additional Context
zoontek/react-native-bootsplash#381
The text was updated successfully, but these errors were encountered: