Environment
In order to solve a crash problem on android caused by Unity, I upgraded my Unity from 2019.4.29f1 to 2019.4.30f1. Unfortunately this time I found a new crash problem. The details information for this problem is as follows:
Caused by java.lang.NullPointerException: Parameter specified as non-null is null: method kotlin.jvm.internal.Intrinsics.checkNotNullParameter, parameter args
at com.facebook.appevents.iap.InAppPurchaseBillingClientWrapper$BillingClientStateListenerWrapper.invoke(:12)
at java.lang.reflect.Proxy.invoke(Proxy.java:1006)
at $Proxy2.onBillingServiceDisconnected()
at com.android.billingclient.api.zzah.onServiceDisconnected(com.android.billingclient:billing@@3.0.3:4)
at android.app.LoadedApk$ServiceDispatcher.doDeath(LoadedApk.java:1811)
at android.app.LoadedApk$ServiceDispatcher$RunConnection.run(LoadedApk.java:1826)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:205)
at android.app.ActivityThread.main(ActivityThread.java:6991)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:884)
According to the information provided on the Firebase Crashlytics dashboard, all crashes occur in the background, and most of them occur on Android 11. After analyzing the information, it seems that the crash occurred on the callback of the onBillingServiceDisconnected event (com.facebook.appevents.iap.InAppPurchaseBillingClientWrapper$BillingClientStateListenerWrapper.invoke). Since I don’t have an Android 11 device, there is no way to reproduce this crash, and I don’t know how to reproduce it. Now onServiceDisconnected event, do you have any suggestions?
Try change your dependencies in Facebook Dependencies from
<androidPackage spec="com.facebook.android:facebook-core:[11.0, 12)" />
<androidPackage spec="com.facebook.android:facebook-applinks:[11.0, 12)" />
<androidPackage spec="com.facebook.android:facebook-login:[11.0, 12)" />
<androidPackage spec="com.facebook.android:facebook-share:[11.0, 12)" />
<androidPackage spec="com.facebook.android:facebook-gamingservices:[11.0, 12)" />
To
<androidPackage spec="com.facebook.android:facebook-core:[11.0, 11.3)" />
<androidPackage spec="com.facebook.android:facebook-applinks:[11.0, 11.3)" />
<androidPackage spec="com.facebook.android:facebook-login:[11.0, 11.3)" />
<androidPackage spec="com.facebook.android:facebook-share:[11.0, 11.3)" />
<androidPackage spec="com.facebook.android:facebook-gamingservices:[11.0, 11.3)" />
As temporary solution it will work