Skip to content

Attempt to invoke virtual method 'com.google.firebase.inappmessaging.model.MessageType com.google.firebase.inappmessaging.model.InAppMessage.getMessageType()' on a null object reference #3596

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
zhaiyunbin opened this issue Mar 29, 2022 · 6 comments

Comments

@zhaiyunbin
Copy link

[REQUIRED] Step 2: Describe your environment

  • Android Studio version: 4.1.2
  • Firebase Component: inappMessaging
  • Component version: 20.1.2

[REQUIRED] Step 3: Describe the problem

Steps to reproduce:

firebase crash

Relevant Code:

Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'com.google.firebase.inappmessaging.model.MessageType com.google.firebase.inappmessaging.model.InAppMessage.getMessageType()' on a null object reference
       at com.google.firebase.inappmessaging.display.FirebaseInAppMessagingDisplay.extractActions(FirebaseInAppMessagingDisplay.java:438)
       at com.google.firebase.inappmessaging.display.FirebaseInAppMessagingDisplay.inflateBinding(FirebaseInAppMessagingDisplay.java:309)
       at com.google.firebase.inappmessaging.display.FirebaseInAppMessagingDisplay.access$000(FirebaseInAppMessagingDisplay.java:79)
       at com.google.firebase.inappmessaging.display.FirebaseInAppMessagingDisplay$1.run(FirebaseInAppMessagingDisplay.java:287)
       at android.os.Handler.handleCallback(Handler.java:938)
       at android.os.Handler.dispatchMessage(Handler.java:99)
       at android.os.Looper.loop(Looper.java:257)
       at android.app.ActivityThread.main(ActivityThread.java:8192)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:626)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1015)
@google-oss-bot
Copy link
Contributor

I found a few problems with this issue:

  • I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
  • This issue does not seem to follow the issue template. Make sure you provide all the required information.

@argzdev
Copy link
Contributor

argzdev commented Mar 29, 2022

Hi @zhaiyunbin, thanks for reporting. Could you provide steps how to reproduce this issue? If you could also provide a minimal repro of the issue, that'll greatly help us in our investigation. Thanks!

@zhaiyunbin
Copy link
Author

zhaiyunbin commented Mar 30, 2022

``> Hi @zhaiyunbin, thanks for reporting. Could you provide steps how to reproduce this issue? If you could also provide a minimal repro of the issue, that'll greatly help us in our investigation. Thanks!

I just add firebase related dependencies ,The in-appmessage message was sent in the firebase console and then the error was found in carsh.

    //firebase 
    implementation platform('com.google.firebase:firebase-bom:29.2.0')
    implementation 'com.google.firebase:firebase-crashlytics'
    implementation 'com.google.firebase:firebase-analytics'
    implementation 'com.google.firebase:firebase-perf'
    implementation 'com.google.firebase:firebase-messaging'
    implementation 'com.google.firebase:firebase-inappmessaging-display'
    //ads
    implementation 'com.google.android.gms:play-services-ads:20.5.0'
    implementation 'com.google.android.gms:play-services-auth:19.2.0'
    //pay
    implementation "com.android.billingclient:billing:4.0.0"

@argzdev
Copy link
Contributor

argzdev commented Mar 30, 2022

Hi @zhaiyunbin, I'm unable to reproduce this issue. Could you answer some details below:

  1. Could you reproduce this issue? If yes, could you provide a minimal repro?
  2. Is this issue persistent? In what Android version are you able to reproduce this issue?
  3. Looking in the code, it seems that the error InAppMessage.getMessageType() is related to the InAppMessage layout. What option did you select in the Firebase InAppMessage Console?

Screen Shot 2022-03-30 at 5 24 26 PM

Thanks!

@zhaiyunbin
Copy link
Author

  • Could you reproduce this issue? If yes, could you provide a minimal repro?
  • Is this issue persistent? In what Android version are you able to reproduce this issue?
  • Looking in the code, it seems that the error InAppMessage.getMessageType() is related to the InAppMessage layout. What option did you select in the Firebase InAppMessage Console?

This message has been deleted,I don't have any more information either...Just remember that the type is Top banner

@argzdev
Copy link
Contributor

argzdev commented Mar 30, 2022

Hi @zhaiyunbin, unfortunately I'm unable to reproduce the issue even with a top banner. Given that the issue is difficult to reproduce, I'm unable to investigate this further. If you could provide more details, it'll greatly help us out. However, I'll close this for now, since there's no way of moving forward. Feel free to reopen once you have more details. Thanks!

@argzdev argzdev closed this as completed Mar 30, 2022
@firebase firebase locked and limited conversation to collaborators Apr 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants