Onesignal-android-sdk: Crash - After IAM click button with "Send to test Device"

Created on 13 Aug 2020  路  7Comments  路  Source: OneSignal/OneSignal-Android-SDK

Description:

Crash app after IAM click button
It happens after add setInAppMessageClickHandler and "Send to test Device" from admin page

Environment

compileSdkVersion 28
targetSdkVersion 28
implementation 'com.onesignal:OneSignal:3.15.2'

Steps to Reproduce Issue:

  • [ADMIN] Create two inapp on admin page.

    • first
    • has button with click action -> add some action name
    • second
    • set 3. Triggers -> When certain conditions are satisfied during the session

      • IN-APP TRIGGER -> any key, any value

  • [Android] add setInAppMessageClickHandler with onesignal.init
  • [Android] add any OneSignal.addTriggers(addTriggers); in inAppMessageClicked
  • [ADMIN] Go first inapp edit page. Click "Send to test Device" on onesignal admin page
  • [Android] Click button on android virtual device
  • [Android] Crash app
  • Anything else:

    2020-08-13 15:49:12.603 5962-5962/com.mindclass.android E/AndroidRuntime: FATAL EXCEPTION: main
        Process: com.mindclass.android, PID: 5962
        java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.String.equals(java.lang.Object)' on a null object reference
            at com.onesignal.OSInAppMessage.equals(OSInAppMessage.java:238)
            at java.util.ArrayList.indexOf(ArrayList.java:331)
            at java.util.ArrayList.contains(ArrayList.java:314)
            at com.onesignal.OSInAppMessageController.dismissCurrentMessage(OSInAppMessageController.java:582)
            at com.onesignal.OSInAppMessageController.messageWasDismissed(OSInAppMessageController.java:565)
            at com.onesignal.OSInAppMessageController.messageWasDismissed(OSInAppMessageController.java:541)
            at com.onesignal.WebViewManager$6.onMessageWasDismissed(WebViewManager.java:352)
            at com.onesignal.InAppMessageView.cleanupViewsAfterDismiss(InAppMessageView.java:457)
            at com.onesignal.InAppMessageView.access$1900(InAppMessageView.java:45)
            at com.onesignal.InAppMessageView$8.onAnimationEnd(InAppMessageView.java:577)
            at android.animation.Animator$AnimatorListener.onAnimationEnd(Animator.java:554)
            at android.animation.ValueAnimator.endAnimation(ValueAnimator.java:1242)
            at android.animation.ValueAnimator.doAnimationFrame(ValueAnimator.java:1484)
            at android.animation.AnimationHandler.doAnimationFrame(AnimationHandler.java:146)
            at android.animation.AnimationHandler.access$100(AnimationHandler.java:37)
            at android.animation.AnimationHandler$1.doFrame(AnimationHandler.java:54)
            at android.view.Choreographer$CallbackRecord.run(Choreographer.java:964)
            at android.view.Choreographer.doCallbacks(Choreographer.java:790)
            at android.view.Choreographer.doFrame(Choreographer.java:721)
            at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:951)
            at android.os.Handler.handleCallback(Handler.java:883)
            at android.os.Handler.dispatchMessage(Handler.java:100)
            at android.os.Looper.loop(Looper.java:214)
            at android.app.ActivityThread.main(ActivityThread.java:7356)
            at java.lang.reflect.Method.invoke(Native Method)
            at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
    

    Help Wanted Possible Bug

    All 7 comments

    Howdy,
    Thank you for the contribution. We will take a look as soon as we can.

    Cheers

    Hello @restart916, thanks for the steps, this is something we will take care of. In the meantime take a look at the new Beta major release, we will love to have your feedback.

    Will this make it into a minor release? I'm running into this same issue on Android (Flutter SDK).

    @MrTarantula
    I fork this repo for temporary in android.
    implementation 'com.github.restart916:OneSignal-Android-SDK:3.15.2.3'

    @restart916 Thanks but for Flutter I think I would need it as a gradle plugin. I'm not quite sure, though, as I'm relatively new to native Android development.

    Same Issue here. OneSignal 3.15.6

    Was this page helpful?
    0 / 5 - 0 ratings