Github user filmaj commented on the issue:

    https://github.com/apache/cordova-plugin-splashscreen/pull/130
  
    OK, I've been able to reproduce the behaviour - sort of. In my case, it 
wasn't that the my app showed the splashscreen, but that the app crashed while 
exiting!
    
    My test app was a fresh cordova project with cordova-android 6.2.3 and 
cordova-plugin-splashscreen 4.0.3 added. I added nothing to the default cordova 
app code other than attaching `splashscreen.show()` to the `beforeunload` 
method, as per your above comment.
    
    Here's my stack trace:
    
    ```
    07-26 12:59:40.652  9214  9214 D CordovaActivity: Stopped the activity.
    07-26 12:59:40.652  9214  9214 D CordovaActivity: 
CordovaActivity.onDestroy()
    07-26 12:59:40.653  9214  9214 D CordovaWebViewImpl: >>> 
loadUrl(about:blank)
    07-26 12:59:40.663  9214  9214 W cr_AwContents: WebView.destroy() called 
while WebView is still attached to window.
    07-26 12:59:40.726  1162  5658 W WindowManager: Attempted to add 
application window with unknown token Token{760cced ActivityRecord{f0b0f04 u0 
io.cordova.hellocordova/.MainActivity t129 f}}.  Aborting.
    07-26 12:59:40.727  9214  9214 D AndroidRuntime: Shutting down VM
    --------- beginning of crash
    07-26 12:59:40.728  9214  9214 E AndroidRuntime: FATAL EXCEPTION: main
    07-26 12:59:40.728  9214  9214 E AndroidRuntime: Process: 
io.cordova.hellocordova, PID: 9214
    07-26 12:59:40.728  9214  9214 E AndroidRuntime: 
android.view.WindowManager$BadTokenException: Unable to add window -- token 
android.os.BinderProxy@1012df7 is not valid; is your activity running?
    07-26 12:59:40.728  9214  9214 E AndroidRuntime:    at 
android.view.ViewRootImpl.setView(ViewRootImpl.java:679)
    07-26 12:59:40.728  9214  9214 E AndroidRuntime:    at 
android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:342)
    07-26 12:59:40.728  9214  9214 E AndroidRuntime:    at 
android.view.WindowManagerImpl.addView(WindowManagerImpl.java:93)
    07-26 12:59:40.728  9214  9214 E AndroidRuntime:    at 
android.app.Dialog.show(Dialog.java:329)
    07-26 12:59:40.728  9214  9214 E AndroidRuntime:    at 
org.apache.cordova.splashscreen.SplashScreen$5.run(SplashScreen.java:318)
    07-26 12:59:40.728  9214  9214 E AndroidRuntime:    at 
android.app.Activity.runOnUiThread(Activity.java:5869)
    07-26 12:59:40.728  9214  9214 E AndroidRuntime:    at 
org.apache.cordova.splashscreen.SplashScreen.showSplashScreen(SplashScreen.java:281)
    07-26 12:59:40.728  9214  9214 E AndroidRuntime:    at 
org.apache.cordova.splashscreen.SplashScreen.onMessage(SplashScreen.java:189)
    07-26 12:59:40.728  9214  9214 E AndroidRuntime:    at 
org.apache.cordova.PluginManager.postMessage(PluginManager.java:312)
    07-26 12:59:40.728  9214  9214 E AndroidRuntime:    at 
org.apache.cordova.CordovaWebViewImpl.postMessage(CordovaWebViewImpl.java:377)
    07-26 12:59:40.728  9214  9214 E AndroidRuntime:    at 
org.apache.cordova.splashscreen.SplashScreen$3.run(SplashScreen.java:169)
    07-26 12:59:40.728  9214  9214 E AndroidRuntime:    at 
android.os.Handler.handleCallback(Handler.java:751)
    07-26 12:59:40.728  9214  9214 E AndroidRuntime:    at 
android.os.Handler.dispatchMessage(Handler.java:95)
    07-26 12:59:40.728  9214  9214 E AndroidRuntime:    at 
android.os.Looper.loop(Looper.java:154)
    07-26 12:59:40.728  9214  9214 E AndroidRuntime:    at 
android.app.ActivityThread.main(ActivityThread.java:6121)
    07-26 12:59:40.728  9214  9214 E AndroidRuntime:    at 
java.lang.reflect.Method.invoke(Native Method)
    07-26 12:59:40.728  9214  9214 E AndroidRuntime:    at 
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:889)
    07-26 12:59:40.728  9214  9214 E AndroidRuntime:    at 
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:779)
    ```
    
    This was on a Google Pixel running Android 7.1.2.
    
    Next up I'll test out your patch and see how the behaviour differs.
    
    FYI @infil00p.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org

Reply via email to