Closed PetkevichPavel closed 3 years ago
I found a few problems with this issue:
Hey @PetkevichPavel thanks for letting us know, We've seen issues with the Window Manager before and I've been trying to nail them down as they come up. I'm curious, for your implementation of FIAM are you triggering FIAM and then changing back and fourth between activities? or triggering FIAM and then immediately killing the triggering activity? something like a splash screen maybe?
Are you able to reproduce this issue at all locally? If you can then the SDK debug logs would be very helpful. To enable debug logging you can do
adb shell setprop log.tag.FIAM.Headless DEBUG
Hi @JasonAHeron , thanks for your quick reply. Unfortunately, but I'm not able to reproduce it locally... Nevertheless, according to the implementation in code, I am only adding few dependencies. But if I understood you correctly, you are talking about triggers IAM, which are based on specific events. In that case, we have predefined following events: app_launch, screen_view, on_foreground.
According to the activities: yes, you're right. I'm using as launcher activity RouterActivity. In other words, SplashScreen, after that, the user is redirected to the specific flow of the app.
And finally, I also see this problem, you're triggering IAM directly on the [app_launch&screen_view&on_foreground], but in my case is the SplashScreen and it will die quicker than the message will appear and here we go....💣
As a result maybe I know few possible solutions:
App.kt
with some specific param such as isSplashScreen.What do you think ? 😅
Thanks for the detailed response, so I actually did a lot of work to try to make this splash screen style workflow work invisibly behind the scenes without crashing. Is this coming from app that use our latest SDK version? https://firebase.google.com/support/release-notes/android#inappmessaging_v19-0-7
If this crash is coming from apps that haven't yet updated to a version depending on 19.0.7 then this issue could very well go away once the users update
Hi @JasonAHeron, as I mentioned in the first message I am using the latest version of the SDK, thats mean that this crash is already coming from the lates version of the SDK.
Absolutely, I saw that, I just know that when you update a dependency in your app and publish it to the app store there can still be months and months of users using older versions of your app. So you're saying the crashes are coming from this version right? not just that your app is currently published from this version?
Are you seeing crashes coming from this version and not prior versions or your app with a different version of our SDK? that would also be helpful to know for tracking this down
@JasonAHeron I double checked it right now, and yes all crashes coming from the latest build which already using the latest SDK.
okay that's really helpful, so this crash just started on the most recent version of the SDK? Did you change the way your app uses activities in this release as well? did your app exist before this release?
I can tell you one work around that will very likely stop your crashes for now as I continue to investigate this. Do not trigger fiam from an activity you are about to stop/destroy. So if you want to trigger FIAM do it from an activity which will actually stay around to display the message rather than triggering from an activity that you're about to kill off or switch from.
@JasonAHeron I got your questions, I will try my best to describe it in one sentence: This project is the fresh deployed, and we start using IAM directly with the latest SDK version, because of that I'm not able to tell you if this bug appeared on the previous versions or not.
As for your temporary solution, currently, I didn't have any additional implementation in the code, what I'm only doing is adding the dependencies on FIAM.
But only for clarification, do you mean that I have to add this trigger FIAM programmatically? or I need to add a specific event which is referred to the particular screen(img below)?
Thank you in advance.
Hello @JasonAHeron, maybe you missed my previous message, nevertheless please can you react on it somehow thank you in advance.
Hey, so by trigger FIAM I mean trigger via any mechanism. It sounds like you're triggering via Firebase Analytics. So what you can do is rather than trigger based on an analytics event that you fire right before killing your activity you can trigger from an event when you start the activity that you're going to.
This is my understanding if your current setup.
Activity 1:
Activity 2:
you can solve this by triggering fiam from activity 2 when it starts rather than from activity 1 when it dies. Does that make sense?
Also we are aware of this and we are working on it but unfortunately I don't always have the time to update this bug with my progress. Thank you for the detailed report though and we are indeed working on it.
I have this issue as well. It started to show up recently (June 26th):
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:1069)
at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:381)
at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:93)
at com.google.firebase.inappmessaging.display.internal.FiamWindowManager.show(FiamWindowManager.java:62)
at com.google.firebase.inappmessaging.display.FirebaseInAppMessagingDisplay$4$4.run(FirebaseInAppMessagingDisplay.java:428)
at android.app.Activity.runOnUiThread(Activity.java:6406)
at com.google.firebase.inappmessaging.display.FirebaseInAppMessagingDisplay$4.onSuccess(FirebaseInAppMessagingDisplay.java:424)
at com.squareup.picasso.RequestCreator.into(RequestCreator.java:721)
at com.google.firebase.inappmessaging.display.internal.FiamImageLoader$FiamImageRequestCreator.into(FiamImageLoader.java:65)
at com.google.firebase.inappmessaging.display.FirebaseInAppMessagingDisplay.loadNullableImage(FirebaseInAppMessagingDisplay.java:506)
at com.google.firebase.inappmessaging.display.FirebaseInAppMessagingDisplay.inflateBinding(FirebaseInAppMessagingDisplay.java:362)
at com.google.firebase.inappmessaging.display.FirebaseInAppMessagingDisplay.access$000(FirebaseInAppMessagingDisplay.java:83)
at com.google.firebase.inappmessaging.display.FirebaseInAppMessagingDisplay$1.run(FirebaseInAppMessagingDisplay.java:298)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7156)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:975)
I'm using InAppMessaging library version 19.0.6. And it happens on different devices such as:
37% samsung
21% Xiaomi
9% motorola
9% HUAWEI
24% Other
I have a single activity app so it's a bit weird.
Experiencing similar issues with this bug as detailed above by @PetkevichPavel - An update on this would be great @JasonAHeron . Thanks
Similar issue is opened here: https://github.com/firebase/firebase-android-sdk/issues/1808 and https://github.com/firebase/firebase-android-sdk/issues/112
@premacck Thank you for notice, I already reacted there.
@JasonAHeron For the last months we weren't face with this issue again, nevertheless as I see from the comments above and also duplicating issues such as #1808, probably the bug is still exist. By start of the year we are planing several campaigns which will use the IAM, and the campaigns will be on the big audience, based on those data I will be able to tell you if this bug is still actual for me or not.
Thank you in advance see you next year.
Merry Christmas & Happy New Year to all 🎊.
have the similar issue:
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:935)
at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:393)
at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:95)
at com.google.firebase.inappmessaging.display.internal.FiamWindowManager.show(FiamWindowManager.java:62)
at com.google.firebase.inappmessaging.display.FirebaseInAppMessagingDisplay$4$4.run(FirebaseInAppMessagingDisplay.java:412)
at android.app.Activity.runOnUiThread(Activity.java:6919)
at com.google.firebase.inappmessaging.display.FirebaseInAppMessagingDisplay$4.onSuccess(FirebaseInAppMessagingDisplay.java:408)
at com.squareup.picasso.ImageViewAction.complete(ImageViewAction.java:52)
at com.squareup.picasso.Picasso.deliverAction(Picasso.java:576)
at com.squareup.picasso.Picasso.complete(Picasso.java:528)
at com.squareup.picasso.Picasso$1.handleMessage(Picasso.java:122)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:241)
at android.app.ActivityThread.main(ActivityThread.java:7617)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:941)
Our app latest version 2.2.3 has the following library version:
implementation 'com.google.firebase:firebase-inappmessaging-display:19.1.2'
+1 Facing same issue. When is it expected to move out of BETA
Same issue here. version 19.1.3
It seems that this issue is fixed in 19.1.5 as mentioned here : https://firebase.google.com/support/release-notes/android#inappmessaging_v19-1-5
I'm still seeing this issue using latest version (20.0)
having the same issue for a long time. any update on this?
At least put try-catch for now 😄
This issue should be fixed in: https://github.com/firebase/firebase-android-sdk/pull/2402
So closing this bug.
Feel free to reopen this if you were able to reproduce the issue with the latest FIAM Display SDK version. Thanks
Basic info:
Describe the problem
We created a new campaign and for some of the users, the application failed during the showing In-App Message.
Here is the crash from crashlytics:
Steps to reproduce:
I can give you all devices which were affected, and maybe it can be helpful for you: 33% - Galaxy S10e 17% - Galaxy S20 Ultra 5G 17% - Galaxy S20 17% - P30 Pro 16% - HUAWEI P smart 2019
Relevant Code:
Nothing to share, it was implemented according to your documentation.