firebase-android-sdk icon indicating copy to clipboard operation
firebase-android-sdk copied to clipboard

NullPointerException at AbtIntegrationHelper.setExperimentActive

Open OlehHaidaienko opened this issue 3 years ago • 17 comments

[REQUIRED] Step 2: Describe your environment

  • Android Studio version: Android Studio Electric Eel | 2022.1.1 Patch 1
  • Firebase Component: In-App Messaging
  • Component version: 20.3.0

[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

OlehHaidaienko avatar Feb 24 '23 17:02 OlehHaidaienko

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

google-oss-bot avatar Feb 24 '23 17:02 google-oss-bot

I'm having the same issue :(

igoralvess avatar Feb 24 '23 20:02 igoralvess

The same issue here, almost 60k users crashing 💣

hallefy avatar Feb 24 '23 20:02 hallefy

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.

argzdev avatar Feb 27 '23 09:02 argzdev

@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 avatar Feb 27 '23 16:02 OlehHaidaienko

@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

OlehHaidaienko avatar Mar 17 '23 14:03 OlehHaidaienko

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

Here are some of my findings:

  • Changes made between versions 20.1.2 to 20.2.0 is during the commit dates between Mar. 10, 2022 - Oct. 12, 2022.
  • History of commits for firebase-inappmessaging shows around 10-11 commits during this timeline (Mar - Oct 2022).
  • All commits in the given timeline doesn't seem to have any changes made to the AbtIntegrationHelper and InAppMessageStreamManager

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

argzdev avatar Mar 17 '23 15:03 argzdev

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

OlehHaidaienko avatar Mar 27 '23 10:03 OlehHaidaienko

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!

argzdev avatar Mar 27 '23 11:03 argzdev

@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 avatar Mar 27 '23 16:03 OlehHaidaienko

@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

OlehHaidaienko avatar Apr 18 '23 11:04 OlehHaidaienko

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.

argzdev avatar Apr 18 '23 13:04 argzdev

I have the same problem

FelipeLimaDeSouza avatar Apr 18 '23 19:04 FelipeLimaDeSouza

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

argzdev avatar Apr 19 '23 10:04 argzdev

Fix merged. Will be available in next release.

eldhosembabu avatar Apr 19 '23 16:04 eldhosembabu

Fix merged. Will be available in next release.

When the new version will be released?

FelipeLimaDeSouza avatar Apr 19 '23 19:04 FelipeLimaDeSouza

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!

argzdev avatar May 02 '23 11:05 argzdev