ionic-team / capacitor-plugins

Official plugins for Capacitor ⚑️
529 stars 597 forks source link

Capacitor Splash Screen plugin is reporting crash error on crashlytics for android 11 kindle device #2149

Closed Hani-bbc closed 3 months ago

Hani-bbc commented 4 months ago

Bug Report

Since the start of June, we've seen an elevated number of crashes in our app for the capacitor splash screen plugin. The crashes are mainly happening on kindle devices that are on Android 11.

We've also recently upgraded our capacitor version to version 6 and are aware that has upgraded the coreSplashScreenVersion as well which we're not sure could potentially fix the issue.

Has there been any changes to this plugin since start of June?

Plugin(s)

@capacitor/splash-screen

Capacitor Version

πŸ’Š   Capacitor Doctor  πŸ’Š

Latest Dependencies:

  @capacitor/cli: 6.1.0
  @capacitor/core: 6.1.0
  @capacitor/android: 6.1.0
  @capacitor/ios: 6.1.0

Installed Dependencies:

  @capacitor/cli: 6.1.0
  @capacitor/core: 6.1.0
  @capacitor/ios: 6.1.0
  @capacitor/android: 6.1.0

Platform(s)

Android 11 Kindle devices:

Additional Context

Our splash screen config:

"SplashScreen": { "launchAutoHide": false, "splashImmersive": true, "androidScaleType": "CENTER_CROP" }

styles.xml:


  <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
    <item name="colorPrimary">@color/colorPrimary</item>
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
    <item name="colorAccent">@color/colorAccent</item>
    <item name="android:forceDarkAllowed">false</item>
  </style>
  <style name="AppTheme.NoActionBar" parent="Theme.AppCompat.DayNight.NoActionBar">
    <item name="android:windowNoTitle">true</item>
    <item name="android:windowActionBar">false</item>
    <item name="windowNoTitle">true</item>
    <item name="windowActionBar">false</item>
    <item name="android:windowFullscreen">true</item>
    <item name="android:forceDarkAllowed">false</item>
  </style>
  <style name="AppTheme.TransparentLaunch" parent="AppTheme.NoActionBar">
    <item name="android:windowContentOverlay">@null</item>
    <item name="android:windowIsTranslucent">false</item>
    <item name="android:windowDisablePreview">true</item>
    <item name="android:forceDarkAllowed">false</item>
    <item name="windowSplashScreenBackground">@color/background_color</item>
  </style>
  <style name="AppTheme.NoActionBarLaunch" parent="Theme.SplashScreen">
    <item name="android:background">@drawable/splash</item>
  </style>
  <color name="background_color">#0261C9</color>

The error stack trace is:

com.capacitorjs.plugins.splashscreen.SplashScreen.lambda$show$8 (SplashScreen.java:460)

Fatal Exception: android.view.WindowManager$BadTokenException: Unable to add window -- token android.os.BinderProxy@eddb35b is not valid; is your activity running?
       at android.view.ViewRootImpl.setView(ViewRootImpl.java:1084)
       at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:409)
       at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:119)
       at com.capacitorjs.plugins.splashscreen.SplashScreen.lambda$show$8(SplashScreen.java:460)
       at com.capacitorjs.plugins.splashscreen.SplashScreen.$r8$lambda$TdrKMei55Y5OrZv3xrjZ6fY3VT0()
       at com.capacitorjs.plugins.splashscreen.SplashScreen$$ExternalSyntheticLambda5.run(:8)
       at android.os.Handler.handleCallback(Handler.java:938)
       at android.os.Handler.dispatchMessage(Handler.java:99)
       at android.os.Looper.loop(Looper.java:223)
       at android.app.ActivityThread.main(ActivityThread.java:7719)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
Ionitron commented 3 months ago

This issue needs more information before it can be addressed. In particular, the reporter needs to provide a minimal sample app that demonstrates the issue. If no sample app is provided within 15 days, the issue will be closed.

Please see the Contributing Guide for how to create a Sample App.

Thanks! Ionitron πŸ’™

Ionitron commented 3 months ago

It looks like this issue didn't get the information it needed, so I'll close it for now. If I made a mistake, sorry! I am just a bot.

Have a great day! Ionitron πŸ’™

ionitron-bot[bot] commented 2 months ago

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.