Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Unity IAP 4.1.4: Internal nullpointer exception in PurchasesResultBridge.getPurchasesList

Discussion in 'Android' started by nztree, May 16, 2022.

  1. nztree

    nztree

    Joined:
    Oct 16, 2016
    Posts:
    9
    Hi team,

    We are seeing a spike in nullpointer exceptions triggered by a call to com.unity3d.services.store.gpbl.bridges.PurchasesResultBridge.getPurchasesList on OnActivity resumed. We are not making any calls to this explicitly, and it appears to be a normal internal process run by the IAP LifeCycleManager. This is occurring in the latest Unity IAP version (4.1.4) on Unity 2021.3.2f1.

    We are unable to reproduce this in development, but receive a sharp incidence of crashes on a very small rollout (even at a super limited rollout of 600 users we're seeing 20+ crashes within hours).

    I can't seem to find this crash appearing on Google yet, so if others are experiencing this hopefully it will be a focal point. Stacktrace below.


    java.lang.Error: FATAL EXCEPTION [main]
    Unity version : 2021.3.2f1
    Scripting Backend : IL2CPP
    ABI : arm64-v8a
    Strip Engine Code : true
    Caused by
    at android.app.ActivityThread.performResumeActivity (ActivityThread.java:4774)
    at android.app.ActivityThread.handleResumeActivity (ActivityThread.java:4816)
    at android.app.servertransaction.ResumeActivityItem.execute (ResumeActivityItem.java:52)
    at android.app.servertransaction.TransactionExecutor.executeLifecycleState (TransactionExecutor.java:187)
    at android.app.servertransaction.TransactionExecutor.execute (TransactionExecutor.java:102)
    at android.app.ActivityThread$H.handleMessage (ActivityThread.java:2316)
    at android.os.Handler.dispatchMessage (Handler.java:106)
    at android.os.Looper.loop (Looper.java:263)
    at android.app.ActivityThread.main (ActivityThread.java:8288)
    at java.lang.reflect.Method.invoke (Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:612)
    at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1006)

    Caused by: java.lang.NullPointerException:
    at com.unity3d.services.store.gpbl.bridges.PurchasesResultBridge.getPurchasesList (PurchasesResultBridge.java:35)
    at com.unity3d.services.store.gpbl.bridges.billingclient.v3.BillingClientBridge.queryPurchasesAsync (BillingClientBridge.java:29)
    at com.unity3d.services.store.gpbl.StoreBilling.getPurchases (StoreBilling.java:57)
    at com.unity3d.services.store.core.StoreLifecycleListener.onActivityResumed (StoreLifecycleListener.java:40)
    at android.app.Application.dispatchActivityResumed (Application.java:451)
    at android.app.Activity.dispatchActivityResumed (Activity.java:1432)
    at android.app.Activity.onResume (Activity.java:1962)
    at com.unity3d.player.UnityPlayerActivity.onResume (UnityPlayerActivity.java:109)
    at android.app.Instrumentation.callActivityOnResume (Instrumentation.java:1457)
    at android.app.Activity.performResume (Activity.java:8289)
    at android.app.ActivityThread.performResumeActivity (ActivityThread.java:4764)
     
  2. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    @nztree This is actually coming from the generic IAP listener in the Ads SDK. They are aware, and looking into it.
     
  3. SanketVaria

    SanketVaria

    Joined:
    Aug 27, 2017
    Posts:
    17
    In my game, Pressing on any IAP causes direct crash with no error. Using the same IAP version 4.1.4. Any ideas on fixing this issue as well?
     
  4. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    Since you can reproduce, you can debug to find out where it's crashing. We have no known reports of this. The easiest is to place Debug.Log statements throughout your code which will show in the device logs. And do not use Codeless IAP. https://forum.unity.com/threads/how-to-capturing-device-logs-on-android.528680/ The IAP subforum is here https://forum.unity.com/forums/unity-iap.112/