play-billing-samples icon indicating copy to clipboard operation
play-billing-samples copied to clipboard

Too many bind requests(999+) for service Intent

Open thevinhhuynh opened this issue 1 year ago • 10 comments

I'm using BILLING: 6.0.0, I encountered the above error. The devices are mainly Samsung

Exception java.lang.IllegalStateException: Too many bind requests(999+) for service Intent { act=com.android.vending.billing.InAppBillingService.BIND pkg=com.android.vending cmp=com.android.vending/com.google.android.finsky.billing.iab.InAppBillingService (has extras) } at android.app.ContextImpl.bindServiceCommon (ContextImpl.java:2115) at android.app.ContextImpl.bindService (ContextImpl.java:2024) at android.content.ContextWrapper.bindService (ContextWrapper.java:870) at com.android.billingclient.api.BillingClientImpl.startConnection (com.android.billingclient:billing@@6.0.0:64) at sdk.platform.android.inapppurchase.InAppPurchaseUtils.connectToGooglePlayBilling (InAppPurchaseUtils.java:83) at sdk.platform.android.inapppurchase.InAppPurchaseUtils$2.onBillingServiceDisconnected (InAppPurchaseUtils.java:87) at com.android.billingclient.api.zzaf.onServiceDisconnected (com.android.billingclient:billing@@6.0.0:5) at android.app.LoadedApk$ServiceDispatcher.doDeath (LoadedApk.java:2368) at android.app.LoadedApk$ServiceDispatcher$RunConnection.run (LoadedApk.java:2383) at android.os.Handler.handleCallback (Handler.java:942) at android.os.Handler.dispatchMessage (Handler.java:99) at android.os.Looper.loopOnce (Looper.java:226) at android.os.Looper.loop (Looper.java:313) at android.app.ActivityThread.main (ActivityThread.java:8757) at java.lang.reflect.Method.invoke at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:571) at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1067)

Help me!

thevinhhuynh avatar Sep 30 '23 08:09 thevinhhuynh

Exactly same issue with some Samsung devices with billing 6.0.1

Fatal Exception: java.lang.IllegalStateException: Too many bind requests(999+) for service Intent { act=com.android.vending.billing.InAppBillingService.BIND pkg=com.android.vending cmp=com.android.vending/com.google.android.finsky.billing.iab.InAppBillingService (has extras) } at android.app.ContextImpl.bindServiceCommon(ContextImpl.java:2115) at android.app.ContextImpl.bindService(ContextImpl.java:2024) at android.content.ContextWrapper.bindService(ContextWrapper.java:870) at com.android.billingclient.api.BillingClientImpl.startConnection(com.android.billingclient:billing@@6.0.1:64)

leCandas avatar Oct 02 '23 09:10 leCandas

same here with PBL 5.0.0 this seems to be Samsung Android 13 bug but still hope we can get some insights

Zachary625 avatar Oct 09 '23 07:10 Zachary625

100% Samsung on Android 13 (from an app with 10m+ installs)

JRWilding avatar Oct 23 '23 13:10 JRWilding

I had the same issue, only coming from Samsung devices.

Since I want to address this quickly. I have surrounded the billingClient.startConnection(this); with a try catch block. When I get an exception I just end the connection billingClient.endConnection(); billingClient = null; And posting a delayed call to a handler to re-initilize the billingClient.

This approach will at least address the crash.

leCandas avatar Oct 24 '23 06:10 leCandas

Same issue using PBL 5.0! Any updates???

kolagit avatar Oct 25 '23 14:10 kolagit

Any updates? I don't know why I got many crashes from one app, but others did not. I tried to downgrade the in-app billing SDK version, but it is not working.

congdanh1608 avatar Nov 14 '23 12:11 congdanh1608

Issue seems to be occurring on Samsung devices running Android 13 (mostly while app is in background). Reference:

  • https://stackoverflow.com/questions/76512231/do-samsung-phones-running-android-13-have-an-intent-bug
  • https://community.revenuecat.com/sdks-51/how-to-fix-crash-too-many-bind-requests-999-for-service-intent-inappbillingservice-3317
  • https://forum.developer.samsung.com/t/illegalstateexception-too-many-bind-requests-999-for-service-inte/28242

igorwojda avatar Dec 05 '23 13:12 igorwojda

I am also using billingclient version 6.0.1 and faced the same issue. Is there any updates on this?

npkhung92 avatar Jan 04 '24 05:01 npkhung92

I am having the same issue.

ErickSorto avatar Jan 17 '24 14:01 ErickSorto

Workaround - make sure that billingClient.startConnection() is called only when app is in foreground

igorwojda avatar Jan 17 '24 18:01 igorwojda