Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to start activity ProxyBillingActivity, NullPointerException by getIntentSender()

We are using the latest Google Play billing client com.android.billingclient:billing:4.1.0 as described in https://developer.android.com/google/play/billing/integrate

Sometimes we get this non-reproducible exception in the crash logs, mostly Android 10 devices.

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.my.app/com.android.billingclient.api.ProxyBillingActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.IntentSender android.app.PendingIntent.getIntentSender()' on a null object reference
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3654)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3806)
    at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
    at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
    at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2267)
    at android.os.Handler.dispatchMessage(Handler.java:107)
    at android.os.Looper.loop(Looper.java:237)
    at android.app.ActivityThread.main(ActivityThread.java:8154)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:496)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1100)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.IntentSender android.app.PendingIntent.getIntentSender()' on a null object reference
    at com.android.billingclient.api.ProxyBillingActivity.onCreate(com.android.billingclient:billing@@4.1.0:12)
    at android.app.Activity.performCreate(Activity.java:7963)
    at android.app.Activity.performCreate(Activity.java:7952)
    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1307)
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3629)
    ... 11 more

Any ideas how to fix/catch?

like image 905
Alexey Ozerov Avatar asked Sep 12 '25 14:09

Alexey Ozerov


1 Answers

I encountered this issue today as well.
To me it seems like the problem is not due to a bug but likely caused by a bot or someone randomly triggering activities, which results in the NullPointerException when accessing the intent.
I've also experienced similar issues with other activities that aren’t designed to be started without parameters.

like image 131
Tobias Avatar answered Sep 15 '25 05:09

Tobias