Firebase In-App Messaging: Window Global Manager and Image View Action issue

822 Views Asked by At

Recently I added the Firebase In-APP Messaging SDK in My App. Some days later, I checked the Firebase crashlytics and saw that there are some crashes related to the In-APP messaging SDK:

1. Window Global Manager (WindowGlobalManager.java)

Here is the stack trace

Caused by java.lang.IllegalArgumentException
View=com.google.firebase.inappmessaging.display.internal.layout.FiamFrameLayout{b98919d VFE...C.. ......ID 0,0-0,0 #7f0a014c app:id/image_root} not attached to window manager


Fatal Exception: 
java.lang.RuntimeException: Unable to pause activity: java.lang.IllegalArgumentException: View=com.google.firebase.inappmessaging.display.internal.layout.FiamFrameLayout{b98919d VFE...C.. ......ID 0,0-0,0 #7f0a014c app:id/image_root} not attached to window manager
    at android.app.ActivityThread.performPauseActivity(ActivityThread.java:3420)
    at android.app.ActivityThread.performPauseActivity(ActivityThread.java:3379)
    at android.app.ActivityThread.handlePauseActivity(ActivityThread.java:3354)
    at android.app.ActivityThread.access$1100(ActivityThread.java:154)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1359)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loop(Looper.java:153)
    at android.app.ActivityThread.main(ActivityThread.java:5472)
    at java.lang.reflect.Method.invoke(Method.java)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

2. Image View Action (ImageViewAction.java)

Here is the stack trace

Fatal Exception: 
android.view.WindowManager$BadTokenException: Unable to add window -- token null is not valid; is your activity running?
    at android.view.ViewRootImpl.setView(ViewRootImpl.java:890)
    at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:337)
    at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:109)
    at com.google.firebase.inappmessaging.display.internal.FiamWindowManager.show(com.google.firebase:firebase-inappmessaging-display@@17.0.3:62)
    at com.google.firebase.inappmessaging.display.FirebaseInAppMessagingDisplay$5.onSuccess(com.google.firebase:firebase-inappmessaging-display@@17.0.3:385)
    at com.squareup.picasso.ImageViewAction.complete(ImageViewAction.java:51)
    at com.squareup.picasso.Picasso.deliverAction(Picasso.java:558)
    at com.squareup.picasso.Picasso.complete(Picasso.java:510)
    at com.squareup.picasso.Picasso$1.handleMessage(Picasso.java:117)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loop(Looper.java:148)
    at android.app.ActivityThread.main(ActivityThread.java:7325)
    at java.lang.reflect.Method.invoke(Method.java)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)

Is there anything that I can do to resolve the above crashes or it has to be resolved by the Google in the SDK?

EDIT: I'm using the following version

implementation 'com.google.firebase:firebase-inappmessaging-display:17.0.3'

Thanks

0

There are 0 best solutions below