What does Play Billing SERVICE_DISCONNECTED (-1) mean?

Play Billing SERVICE_DISCONNECTED (-1) means the app is not connected to the Google Play Store service through the Billing Library.

Quick facts#

Error BillingClient.BillingResponseCode.SERVICE_DISCONNECTED (-1)
Where Google Play Billing Library (BillingResult.responseCode)
What the vendor says The app is not connected to the Play Store service through the Google Play Billing Library.

Cause#

  • Google lists two examples: the Play Store was updated in the background while the app ran and the library lost the connection, or startConnection() was never called or has not finished yet.
  • Google calls the state transient, so the right answer is a reconnect and a retry, not a message that a purchase failed.
  • Billing Library 8.0.0 added enableAutoServiceReconnection(), which reconnects when you make a call while disconnected.

Fix#

  1. Enable automatic service reconnection when you build the BillingClient. Google strongly recommends it from version 8.0.0.
  2. If you do not use it, check billingClient.isReady before every call and call startConnection() again after a disconnect.
  3. If you still get the code after automatic reconnection, retry: simply for actions the person is waiting on, and with exponential backoff for background work.
  4. Cap the number of retries: Google's own example stops after three attempts, two seconds apart.

Example#

Kotlin
import com.android.billingclient.api.BillingClient
import com.android.billingclient.api.PendingPurchasesParams
import com.android.billingclient.api.PurchasesUpdatedListener

// Let the library reconnect for you; this is Google's recommended fix for SERVICE_DISCONNECTED (Billing Library 8.0.0 or later).
fun buildClient(context: android.content.Context, listener: PurchasesUpdatedListener): BillingClient =
    BillingClient.newBuilder(context)
        .setListener(listener)
        .enablePendingPurchases(PendingPurchasesParams.newBuilder().enableOneTimeProducts().build())
        .enableAutoServiceReconnection()
        .build()

Not compiled: this Kotlin snippet was not built here because the docs repo has no Kotlin or Android toolchain. Check it against your Play Billing Library or SDK version before you ship it.

How the RevenueDot SDK reports it#

The RevenueDot purchases-android fork maps SERVICE_DISCONNECTED to PurchasesErrorCode.StoreProblemError (code 2). The SDK owns the BillingClient and reconnects on its own, so your app sees the error only when that fails. See what storeProblemError means.

Source#

Checked: 2026-10-03

Edit this page on GitHub ↗ View as Markdown Last updated