firebase / firebase-android-sdk

Firebase Android SDK
https://firebase.google.com
Apache License 2.0
2.29k stars 579 forks source link

NullPointerException at AbtIntegrationHelper.setExperimentActive #4716

Closed OlehHaidaienko closed 1 year ago

OlehHaidaienko commented 1 year ago

[REQUIRED] Step 2: Describe your environment

[REQUIRED] Step 3: Describe the problem

Steps to reproduce:

I can't reproduce. Please take a look at the log and screenshot from Firebase Crashlytics

Caused by java.lang.NullPointerException: Attempt to invoke interface method 'void java.util.concurrent.Executor.execute(java.lang.Runnable)' on a null object reference
       at com.google.firebase.inappmessaging.internal.AbtIntegrationHelper.setExperimentActive(AbtIntegrationHelper.java:94)
       at com.google.firebase.inappmessaging.internal.InAppMessageStreamManager.triggeredInAppMessage(InAppMessageStreamManager.java:363)
       at com.google.firebase.inappmessaging.internal.InAppMessageStreamManager.lambda$getTriggeredInAppMessageMaybe$27(InAppMessageStreamManager.java:346)
       at com.google.firebase.inappmessaging.internal.InAppMessageStreamManager.$r8$lambda$w4tUspl0-bTh48AvRyCAZ0a1mSM(InAppMessageStreamManager.java)
       at com.google.firebase.inappmessaging.internal.InAppMessageStreamManager$$InternalSyntheticLambda$1$4b09f0da19d4914563fbc47a8eb385ca850290e0e2e34b6d79e30263981ca83c$3.apply(InAppMessageStreamManager.java:6)
       at io.reactivex.internal.operators.maybe.MaybeFlatten$FlatMapMaybeObserver.onSuccess(MaybeFlatten.java:88)
       at io.reactivex.internal.operators.flowable.FlowableElementAtMaybe$ElementAtSubscriber.onNext(FlowableElementAtMaybe.java:80)
       at io.reactivex.internal.operators.flowable.FlowableFlattenIterable$FlattenIterableSubscriber.drain(FlowableFlattenIterable.java:312)
       at io.reactivex.internal.operators.flowable.FlowableFlattenIterable$FlattenIterableSubscriber.onNext(FlowableFlattenIterable.java:174)
       at io.reactivex.internal.operators.flowable.FlowableMap$MapSubscriber.onNext(FlowableMap.java:56)
image
google-oss-bot commented 1 year ago

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

igoralvess commented 1 year ago

I'm having the same issue :(

hallefy commented 1 year ago

The same issue here, almost 60k users crashing 💣

argzdev commented 1 year ago

Hi all, did you happen to use an earlier version prior to encountering this problem? Would it be possible for you to provide us with the previous version that was working?

However, if there were no changes made to the version before the problem occurred, it's possible that the issue is related to the backend. In that case, please reach out to our Firebase support team. They can assist you better since you'll be able to share project details and campaign configurations.

OlehHaidaienko commented 1 year ago

@argzdev Hi, we have this crash only in the latest versions of the app where we updated Firebase BoM from 29.2.0 to 31.1.1. As I see the In-App Message was updated from 20.1.2 to 20.2.0

OlehHaidaienko commented 1 year ago

@argzdev HI, after monitoring this issue for a while I can confirm that it appears only in versions where Firebase BoM was updated. We're gonna update BoM to 31.2.3 and will check if the crash still exists

argzdev commented 1 year ago

Hey @OlehHaidaienko, sorry for the radio silence here. We're still investigating this. Thanks for the extra details.

Here are some of my findings:

We'll reply back here once once we get some further updates.

OlehHaidaienko commented 1 year ago

Hi @argzdev We started rolling out a new app version with updated Firebase BoM 31.2.3 but the issue still exists Currently, 16k crash events affecting ~2.7k users. I could provide some extra logs if you need

argzdev commented 1 year ago

Hi guys, we're still investigating this. Any chance you could share with us the setup of your campaign. Please do remove any PII (personal identifiable information) if needed. This might give us an idea what's causing the issue.

Yes, those extra logs will be helpful, @OlehHaidaienko. Thanks!

OlehHaidaienko commented 1 year ago

@argzdev What information do you need regarding campaign setup? Btw I checked all active campaigns that we have and wasn’t able to reproduce the crash but I noticed something weird. In InAppMessageStreamManager.triggeredInAppMessage method I see that abtIntegrationHelper.executor is null.

image

Seems if this condition will be true you should get NPE content.getPayloadCase().equals(ThickContent.PayloadCase.EXPERIMENTAL_PAYLOAD) Maybe this information will help

OlehHaidaienko commented 1 year ago

@argzdev Hi, please try the following steps to reproduce the issue:

  1. Create an experiment for in-app messages with multiple variants(images in our case)
  2. Activate the experiment
  3. Open the app
  4. Observe crash

Note: App won't crash if you added your device as a test device in the experiment because of the check !content.getIsTestCampaign()

if (!content.getIsTestCampaign()) {
    abtIntegrationHelper.setExperimentActive(
        content.getExperimentalPayload().getExperimentPayload()
    )
}

I hope it will help to investigate the issue

argzdev commented 1 year ago

Sorry for the radio silence here. Really appreciate the updates, @OlehHaidaienko. I was able to reproduce the same behavior from your steps to reproduce the issue. I'll bring this up to our engineers and see what we can do here.

FelipeLimaDeSouza commented 1 year ago

I have the same problem

argzdev commented 1 year ago

Hi all, a fix is on the way #4913. Thank you for your patience.

eldhosembabu commented 1 year ago

Fix merged. Will be available in next release.

FelipeLimaDeSouza commented 1 year ago

Fix merged. Will be available in next release.

When the new version will be released?

argzdev commented 1 year ago

Hi all, this fix is now release on Firebase BoM version 32.0.0 or In-App Messaging version 20.3.2. You may check out the release notes for more information. I'll close this issue now. Thanks!