firebase-android-sdk: Random crash related with In-App Messaging

[REQUIRED] Step 2: Describe your environment

  • Android Studio version: 3.2.1
  • Firebase Component: In-App Messaging
  • Component version: 17.0.3

[REQUIRED] Step 3: Describe the problem

Steps to reproduce:

I set up campaign which should show “modal” triggered by “on_foreground” event. From time to time I receive below crash. There are no reasonable reproduce steps. It just happens. I have found that the same issue was reported on picasso project: https://github.com/square/picasso/issues/2002

11-02 12:43:13.888 27311-27311/pl.allegro.sale.debug E/AndroidRuntime: FATAL EXCEPTION: main
Process: pl.allegro.sale.debug, PID: 27311
android.view.WindowManager$BadTokenException: Unable to add window – token null is not valid; is your activity running?
at android.view.ViewRootImpl.setView(ViewRootImpl.java:849)
at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:337)
at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91)
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.google.firebase.inappmessaging.display.FirebaseInAppMessagingDisplay.loadNullableImage(com.google.firebase:firebase-inappmessaging-display@@17.0.3:418)
at com.google.firebase.inappmessaging.display.FirebaseInAppMessagingDisplay.inflateBinding(com.google.firebase:firebase-inappmessaging-display@@17.0.3:324)
at com.google.firebase.inappmessaging.display.FirebaseInAppMessagingDisplay.access$400(com.google.firebase:firebase-inappmessaging-display@@17.0.3:73)
at com.google.firebase.inappmessaging.display.FirebaseInAppMessagingDisplay$2.run(com.google.firebase:firebase-inappmessaging-display@@17.0.3:267)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:158)
at android.app.ActivityThread.main(ActivityThread.java:7224)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 6
  • Comments: 37 (10 by maintainers)

Most upvoted comments

So… Is it going to be fixed? We cannot use in-app messages because of it - it causes mass crashes in our app and we cannot even handle it.

As far as I understood, the problem is with Picasso - maybe you should switch to Glide? Or fix the issue by adding a simple null check for activity?

@vkryachko @samtstern @MeghaB @JasonAHeron please re-open this issue, it’s not fixed & still occurring.

I do not think they care about this and that is why I will stop using Firebase In-App Messaging and I will make my own one. It is sad: I was supposed to save time using Firebase features 😐

@JasonAHeron , this is NOT fixed… and as far as i know google is putting ZERO EFFORTS in solving it because this is a fee free google tool… so they dont get any money from us for doing it they dont give a shit about supporting us in counterpart

you can use FCM to create a tool for doing the same thing in-app messaging does… I did

Same crash detected by Crashlytics in my app. I tried to reproduce it, but I found nothing so far. I tried to finish my Activity during IAM fetch, but it just lost the message. No crashes. Do you have any update about it?

Please feel free to contact me if you need more information. I’d like to help you.

cc @JasonAHeron … I knew the day would come when we’d have to reckon with FiamWindowManager