Launch offer for the first 500 accounts: $10K MTR free for 24 months + $100 credit →
    .io
    All in-app purchase development guides
    Engineering
    November 24, 2026
    12 min read

    Google Play Billing Library 8 and 9 Migration Guide

    BillDog Team

    BillDog Team

    Growth & Monetization

    If your Android update was blocked because of Google Play Billing Library 7, move to version 9.1.0, not 8, unless a billing SDK you use is still built on 8, or your app supports API 21–22 (then stay on 8.0.0). Google's version 9 guide covers the jump from 7 in one step, and 9 is supported a year longer. The work is mostly mechanical: pass parameters to enablePendingPurchases, handle the new queryProductDetailsAsync result, replace queryPurchaseHistoryAsync, and drop the SkuDetails classes.

    Play Billing Library 7 is deprecated, and the deadline has already passed. Google's deprecation table says new apps and updates had to use version 8 or later by August 31, 2026, and the extension you could request ended on November 1, 2026. Apps already installed keep working; you just can't ship an update until you upgrade.

    This guide is for teams that call the Play Billing Library (PBL) directly, and for teams on a billing SDK who want to know what they still have to check themselves. It covers Android only; for iOS, see the StoreKit 2 subscriptions guide. The Kotlin was compiled against billing-ktx 9.1.0 with Kotlin 2.2.20, compileSdk 35 and minSdk 23. Java callers use the same classes and builders, without the billing-ktx suspend extensions. Purchases still need testing on a device with a license tester, which this guide doesn't replace.

    Play Billing Library deprecation deadlines

    Google says every Play Billing Library version has a two-year deprecation cycle. Google's table (Google gives no time zone):

    Version New apps and updates must stop using it by Extension deadline
    6 August 31, 2025 November 1, 2025
    7 August 31, 2026 November 1, 2026
    8 August 31, 2027 November 1, 2027
    9 August 31, 2028 November 1, 2028

    If your app uses an unsupported version, Play Console shows a warning, and the extension form is on that warning's page under Policy status. For version 7 the extension is no longer useful: it ended on November 1.

    Play Billing Library 8 or 9?

    Go to 9.1.0, the newest release (June 18, 2026). Three reasons:

    1. It's the same work. Google's PBL 9 migration guide starts from version 7 or 8. Everything 8 removed, 9 removes too, so you fix the same call sites either way.
    2. The extra removals are leftovers. On top of what 8 removed, 9 deletes the SkuDetails family and BillingClient.SkuType. Once 8 removed querySkuDetailsAsync, an app on 8 already queries through ProductDetails.
    3. It buys a year. Version 8 has to go by August 31, 2027. Version 9 lasts until August 31, 2028.

    There are two reasons to stop at 8 for now:

    • A billing SDK in your app is built against 8. Gradle picks the highest version requested anywhere in the dependency graph. If you declare 9.1.0 and an SDK still calls something 9 removed, the build succeeds and the call fails at runtime, with NoSuchMethodError for a removed method or NoClassDefFoundError for a removed class. Check your SDK's release notes first (see If you use a billing SDK).
    • Your app still supports Android 5 (API 21 or 22). Version 7.0.0 set the library's minSdkVersion to 21, and 8.1.0 raised it to 23; versions 9.0.0 and 9.1.0 also require 23 (we read the published AAR manifests to confirm). On a lower minSdk the manifest merger stops the build, unless you override it with tools:overrideLibrary, which only makes sense if you then keep billing away from those devices. Version 8.0.0 gives you until August 31, 2027 to decide.

    What breaks: the removed APIs

    Google's migration guides and release notes, merged into one table. "Removed in" is the first version without the API. If you are on 7 and moving to 9, you handle the rows marked 8 and 9. The rows marked 7 only matter if you are still on 6. Google's version 8 guide labels them as removed in 8, but the 7.0.0 release notes list them under 7.0.0, so we follow the release notes.

    Removed API Removed in Use instead
    enablePendingPurchases() with no arguments 8 enablePendingPurchases(PendingPurchasesParams)
    querySkuDetailsAsync 8 queryProductDetailsAsync
    queryPurchaseHistoryAsync 8 No device API; see Purchase history is gone
    queryPurchasesAsync(String skuType, listener) 8 queryPurchasesAsync(QueryPurchasesParams, listener)
    SkuDetails, SkuDetailsParams, SkuDetailsResponseListener 9 ProductDetails, QueryProductDetailsParams, ProductDetailsResponseListener
    BillingClient.SkuType 9 BillingClient.ProductType (INAPP and SUBS work the same way)
    getSkuDetailsList, setSkuDetailsList 9 BillingFlowParams.Builder.setProductDetailsParamsList
    QueryPurchaseHistoryParams 9 queryPurchasesAsync, plus your own server records (one table in Google's version 9 guide says queryProductDetailsAsync here, which looks like a typo)
    enableAlternativeBilling, AlternativeBillingListener, AlternativeChoiceDetails 7 enableUserChoiceBilling, UserChoiceBillingListener, UserChoiceDetails
    setOldSkuPurchaseToken 7 setOldPurchaseToken
    setReplaceProrationMode, setReplaceSkusProrationMode 7 setSubscriptionReplacementMode

    Changed rather than removed: ProductDetailsResponseListener.onProductDetailsResponse now receives a QueryProductDetailsResult instead of a list (8.0.0). That one hits every app that queries products.

    The migration, step by step

    1. Bump the dependency

    // app/build.gradle.kts
    dependencies {
        implementation("com.android.billingclient:billing-ktx:9.1.0")
    }
    

    Use billing instead of billing-ktx if you don't want the coroutine extensions. Then check what Gradle actually resolved, because an SDK can pull in a different version:

    ./gradlew :app:dependencies --configuration releaseRuntimeClasspath | grep billingclient
    

    2. Build the client

    Two changes in the builder. The no-argument enablePendingPurchases() is gone, and 8.0.0 added automatic reconnection, which Google strongly recommends.

    import android.content.Context
    import com.android.billingclient.api.BillingClient
    import com.android.billingclient.api.PendingPurchasesParams
    import com.android.billingclient.api.PurchasesUpdatedListener
    
    fun buildBillingClient(context: Context, listener: PurchasesUpdatedListener): BillingClient =
        BillingClient.newBuilder(context)
            .setListener(listener)
            // Same behaviour as the removed no-argument enablePendingPurchases().
            .enablePendingPurchases(
                PendingPurchasesParams.newBuilder().enableOneTimeProducts().build()
            )
            // PBL 8.0.0+: reconnect when a call finds the service disconnected.
            .enableAutoServiceReconnection()
            .build()
    

    With reconnection on, you no longer call startConnection() again after a disconnect. If a call still returns SERVICE_DISCONNECTED, Google says the automatic attempts failed: retry simply for something the user just tapped, and with exponential backoff for background work.

    3. Handle the new product query result

    This is the change you will notice. Before 8.0.0, a product that couldn't be fetched just wasn't in the list. Now the result carries both lists, and each missing product has a status code.

    import android.util.Log
    import com.android.billingclient.api.BillingClient
    import com.android.billingclient.api.ProductDetails
    import com.android.billingclient.api.QueryProductDetailsParams
    import com.android.billingclient.api.UnfetchedProduct
    
    fun loadSubscriptions(
        client: BillingClient,
        productIds: List<String>,
        onLoaded: (List<ProductDetails>) -> Unit,
    ) {
        val params = QueryProductDetailsParams.newBuilder()
            .setProductList(
                productIds.map { id ->
                    QueryProductDetailsParams.Product.newBuilder()
                        .setProductId(id)
                        .setProductType(BillingClient.ProductType.SUBS)
                        .build()
                }
            )
            .build()
    
        client.queryProductDetailsAsync(params) { billingResult, result ->
            if (billingResult.responseCode != BillingClient.BillingResponseCode.OK) {
                Log.w("Billing", "Product query failed: ${billingResult.debugMessage}")
                return@queryProductDetailsAsync
            }
            for (missing in result.unfetchedProductList) {
                val reason = when (missing.statusCode) {
                    UnfetchedProduct.StatusCode.PRODUCT_NOT_FOUND -> "not found"
                    UnfetchedProduct.StatusCode.NO_ELIGIBLE_OFFER -> "no eligible offer"
                    UnfetchedProduct.StatusCode.INVALID_PRODUCT_ID_FORMAT -> "invalid ID format"
                    else -> "unknown"
                }
                Log.w("Billing", "${missing.productId} not loaded: $reason")
            }
            onLoaded(result.productDetailsList)
        }
    }
    

    Log these codes; they answer the oldest Play Billing question, "why is my product missing?". Google's reference gives examples for each:

    • PRODUCT_NOT_FOUND: the product was deleted or never created, the product type is wrong, or it was just created and hasn't propagated yet.
    • NO_ELIGIBLE_OFFER: the product exists, but a subscription has no available base plan, or a one-time product has no purchase option.

    If no products load at all, see no products on Android.

    Don't cache ProductDetails objects. Google warns that stale ones can make launchBillingFlow() fail.

    4. Query purchases with parameters, and handle suspended subscriptions

    The skuType overload of queryPurchasesAsync is gone. Use QueryPurchasesParams. From 8.1.0 you can also ask for suspended subscriptions: ones the user paused, or whose renewal payment was declined.

    import com.android.billingclient.api.BillingClient
    import com.android.billingclient.api.Purchase
    import com.android.billingclient.api.QueryPurchasesParams
    import com.android.billingclient.api.queryPurchasesAsync
    
    data class SubscriptionState(val active: List<Purchase>, val suspended: List<Purchase>)
    
    suspend fun loadSubscriptionState(client: BillingClient): SubscriptionState? {
        val params = QueryPurchasesParams.newBuilder()
            .setProductType(BillingClient.ProductType.SUBS)
            .includeSuspendedSubscriptions(true) // PBL 8.1.0+
            .build()
    
        val result = client.queryPurchasesAsync(params) // billing-ktx suspend extension
        if (result.billingResult.responseCode != BillingClient.BillingResponseCode.OK) return null
    
        val purchased = result.purchasesList.filter {
            it.purchaseState == Purchase.PurchaseState.PURCHASED
        }
        val (suspended, active) = purchased.partition { it.isSuspended }
        return SubscriptionState(active = active, suspended = suspended)
    }
    

    Grant access only for active. For suspended, Google says not to grant the subscription and to send the user to the Play subscriptions center to fix their payment method or resume.

    5. Purchase history is gone

    queryPurchaseHistoryAsync was removed in 8, and 9 removes QueryPurchaseHistoryParams. There is no device-side replacement. Google's guidance:

    • queryPurchasesAsync for active and pending purchases;
    • your own server for consumed purchases;
    • the server-side Voided Purchases API for canceled or voided ones.

    If you used history to decide whether someone gets a free trial, stop. Google says to use ProductDetails.getSubscriptionOfferDetails() instead: it returns the offers this user is eligible for.

    This is the migration step that can't be done in the app. If you never recorded purchases on a server, start now, because history you didn't store is not coming back.

    6. Read the new purchase error details

    Since 8.0.0, a failed purchase can carry a sub-response code. Google's sources disagree on where: the release notes put it on the BillingResult that launchBillingFlow() returns, and the API reference says it is returned in PurchasesUpdatedListener.onPurchasesUpdated. Read onPurchasesUpdatedSubResponseCode from both; the listener below covers the second.

    import com.android.billingclient.api.BillingClient.BillingResponseCode
    import com.android.billingclient.api.BillingClient.OnPurchasesUpdatedSubResponseCode
    import com.android.billingclient.api.Purchase
    import com.android.billingclient.api.PurchasesUpdatedListener
    
    fun purchasesListener(
        onPurchase: (Purchase) -> Unit,
        showMessage: (String) -> Unit,
    ) = PurchasesUpdatedListener { billingResult, purchases ->
        when (billingResult.responseCode) {
            BillingResponseCode.OK -> purchases?.forEach(onPurchase)
            BillingResponseCode.USER_CANCELED -> Unit
            // PBL 9: a Play Store blocked by the system (e.g. an OEM kids mode)
            // returns BILLING_UNAVAILABLE instead of ERROR.
            BillingResponseCode.BILLING_UNAVAILABLE ->
                showMessage("Google Play purchases aren't available on this device.")
            else -> when (billingResult.onPurchasesUpdatedSubResponseCode) {
                OnPurchasesUpdatedSubResponseCode.PAYMENT_DECLINED_DUE_TO_INSUFFICIENT_FUNDS ->
                    showMessage("The payment was declined. Try another payment method.")
                OnPurchasesUpdatedSubResponseCode.USER_INELIGIBLE ->
                    showMessage("This offer isn't available on your account.")
                else -> showMessage("The purchase didn't go through. Please try again.")
            }
        }
    }
    

    The BILLING_UNAVAILABLE change compiles cleanly, so unit tests with mocked results won't flag it. If your code treated ERROR as "retry", a device with a blocked Play Store now lands in a different branch. Google notes it needs AndroidX Core 1.9 or later; the 9.1.0 POM already depends on androidx.core:core 1.15.0, so you only miss it if you force an older version.

    7. Upgrades and downgrades (only if you came from 6, or want the new API)

    If you still call setOldSkuPurchaseToken or setReplaceProrationMode, you are coming from 6 (both were removed in 7.0.0); switch to setOldPurchaseToken and setSubscriptionReplacementMode. Version 8.1.0 also added a per-product way to do this, ProductDetailsParams.Builder.setSubscriptionProductReplacementParams(), and says SubscriptionUpdateParams.setSubscriptionReplacementMode will be deprecated. Move when you next touch your plan-change code, not as part of this migration.

    8. External payments only: getLinkUri() can be null

    If you use DeveloperProvidedBillingDetails for external payments, 9.0.0 made getLinkUri() @Nullable. Check for both null and empty before opening it. Everyone else can skip this.

    What the compiler won't catch

    The removed methods fail the build, which is the easy part. These don't:

    • Acknowledgement is unchanged and still strict. Google refunds a purchase and revokes the entitlement if it isn't acknowledged within three days. A migration that breaks your acknowledge path ships fine and loses money three days later. See purchases refunded after three days for what that looks like and how to find it.
    • Missing products are now explained, not hidden. If you show an error when a product is absent, check that it doesn't fire on NO_ELIGIBLE_OFFER for products that are fine for other users.
    • Two response codes moved. In 8.3.0, a user who leaves the purchase flow to pay in an external app (such as an e-wallet) and never comes back now gets USER_CANCELED with the debug message BILLING_ACTIVITY_PAUSED, not ERROR. In 9.0.0, a Play Store blocked by the system returns BILLING_UNAVAILABLE, not ERROR.
    • Google's own samples lag. The Java sample on Google's error-handling page still calls the no-argument enablePendingPurchases() that 8.0.0 removed; its Kotlin sample uses the new form. Copy from the migration guides, not from older snippets.
    • The warning can outlive the fix. If Play Console still shows the deprecation warning after you upgraded, Google says to check that your merged AndroidManifest.xml contains com.google.android.play.billingclient.version and, if it's missing, whether manifest merging removed it.
    • A transitive version can override yours. Run the dependency command in step 1 on the release build, not only debug.

    If you use a billing SDK

    Most billing SDKs pin a Play Billing Library version, and the one you get is whatever their release ships. What each SDK's latest release declares, from its own published package or changelog, checked on this guide's publish date:

    SDK Latest release checked Play Billing Library it declares
    RevenueCat Android (purchases-android) 11.4.3 (11.0.0 moved to 9.1.0) 9.1.0
    Flutter in_app_purchase_android 0.5.5 9.1.0
    react-native-iap 17.4.1, through OpenIAP openiap-google 4.2.1 9.1.0
    Qonversion Android 9.8.0 8.1.0
    Adapty Android 4.4.0 (the newest on Maven Central) 8.0.0

    Two notes from those changelogs. RevenueCat's 11.0.0 warns that apps must now compile against API 35 or later, because Play Billing Library 9 depends on androidx.core 1.15.0. Flutter's 0.5.5 raises its minimum Android SDK to 23 and calls out the BILLING_UNAVAILABLE change as a behaviour change.

    If your SDK declares 8.x, stay on 8 for now (it's supported until August 31, 2027) and move when the SDK does. Forcing 9.1.0 over an SDK built for 8 is the runtime-error case described above.

    Whatever the SDK, three checks stay yours:

    1. Run the dependency command from step 1 and confirm which com.android.billingclient version ends up in the release build.
    2. If you call BillingClient anywhere yourself (a second client for one-time products, a restore button, an analytics hook), that code needs the same changes as above.
    3. Test real purchases with a license tester, including a renewal and a declined payment. License testers get test payment methods that don't charge real money, and can sideload debug builds as long as the package name matches the app in Play Console.

    How BillDog helps

    BillDog's Android SDK records Google Play purchases on BillDog's server. Version 1.2.0-beta.1 is built against Play Billing Library 8.0.0: billdog-paywall brings in billing-ktx 8.0.0.

    When BillDog's own purchase controller runs the purchase (with finishTransactions on, the default), it acknowledges or consumes it. When your own BillingClient completes the purchase, BillDog records it but never acknowledges it; that stays with your code. The exception is a controller that hands finishing to BillDog, such as RevenueCat with purchasesAreCompletedBy set to MY_APP. Setup is in the Android guide, Google Play setup and, for RevenueCat, the RevenueCat integration guide.

    We haven't released a BillDog build against version 9 yet, so the advice for SDKs above applies to BillDog too: with 1.2.0-beta.1, stay on Play Billing Library 8 until a BillDog release moves to 9.

    Sources

    Frequently asked questions

    Can I still publish an update with Play Billing Library 7?

    No. Google's deadline for version 7 was August 31, 2026, and the extension you could request ran until November 1, 2026. New apps and updates must now use version 8 or later. Existing installs keep working.

    Should I migrate to Play Billing Library 8 or 9?

    Version 9 if you can. Google's version 9 guide covers moving from 7 in one step, the extra removals since 8 are classes most apps no longer use, and version 9 is supported until August 31, 2028 instead of August 31, 2027. Stay on 8 only if a billing SDK you depend on hasn't moved yet, or your app still supports API 21–22 (then 8.0.0 specifically).

    What replaces queryPurchaseHistoryAsync in Play Billing Library 8?

    Nothing on the device. Google says to use queryPurchasesAsync for active and pending purchases, track consumed purchases on your own server, and use the server-side Voided Purchases API for canceled or voided purchases.

    Why does queryProductDetailsAsync return fewer products after upgrading?

    It doesn't return fewer; it now tells you about the missing ones. Since version 8 the result has an unfetchedProductList, and each UnfetchedProduct has a status code such as PRODUCT_NOT_FOUND or NO_ELIGIBLE_OFFER.

    Does Play Billing Library 9 change the minimum SDK?

    Version 8.1.0 raised the library's minSdkVersion to 23, and 9.0.0 and 9.1.0 keep it at 23. Version 8.0.0 is the last release that still supports API 21 and 22.

    Topics: #AndroidDev#GooglePlay#Kotlin#InAppPurchases

    Get the BillDog newsletter

    Practical guides on subscription pricing, paywalls and app growth, about twice a month. No spam.

    Related Articles

    November 17, 2026

    We use cookies and process your data to provide our services. By continuing, you agree to our Terms and Privacy Policy.