最近我Firebase In-APP Messaging
在我的应用程序中添加了 SDK。几天后,我查了一下Firebase crashlytics
,发现有一些与应用内消息 SDK 相关的崩溃:
1. 窗口全局管理器(WindowGlobalManager.java)
这是堆栈跟踪
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.图像视图动作(ImageViewAction.java)
这是堆栈跟踪
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)
有什么办法可以解决上述崩溃问题,或者必须由 Google 在 SDK 中解决?
编辑:我正在使用以下版本
implementation 'com.google.firebase:firebase-inappmessaging-display:17.0.3'
谢谢