play-billing-library-version-upgrade

Migrates Android projects from legacy Play Billing Library versions to the latest stable release.

3|Updated Aug 4, 2024
One-click install
npx skills add https://github.com/kabindra-shrestha/Clean-Architecture-Kotlin-Compose-Multiplatform --skill play-billing-library-version-upgrade-kabindra-shrestha
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: play-billing-library-version-upgrade
Source: https://github.com/kabindra-shrestha/Clean-Architecture-Kotlin-Compose-Multiplatform/tree/main/.agents/skills/play/play-billing-library-version-upgrade
Command: npx skills add https://github.com/kabindra-shrestha/Clean-Architecture-Kotlin-Compose-Multiplatform --skill play-billing-library-version-upgrade-kabindra-shrestha

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Upgrading the Google Play Billing Library across major versions involves breaking API changes, deprecated classes like SkuDetails, and shifting SDK requirements that are easy to miss and cause build failures or runtime crashes. ## Core Features & Use Cases - Effective Version Detection: Scans build files and source code for deprecated APIs to determine the true baseline version, even when the declared dependency version is misleading. - Direct or Stepped Migration Paths: Plans a direct upgrade when within two major versions of the target, or a stepped migration (e.g., v4 to v6 to v8) with intermediate build verification. - Intent-Based Refactoring: Replaces legacy patterns such as manual reconnection retries with enableAutoServiceReconnection() and SkuDetails with ProductDetails, guided by version-specific checklists and release notes. - Use Case: An Android app still using PBL v5 with SkuDetails and synchronous queryPurchases() needs to reach PBL 9; the skill refactors the code, updates compileSdk to 35, and validates with a clean build and tests. ## Quick Start Upgrade my Android project's Play Billing Library to the latest stable version and verify the migration with a clean build.

Frequently Asked Questions about play-billing-library-version-upgrade

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I upgrade Google Play Billing Library to the latest version?

Update the com.android.billingclient:billing dependency in build.gradle or libs.versions.toml, then refactor deprecated APIs per the migration guides. This skill detects your effective version, plans a direct or stepped path, and validates with clean builds and tests.

How to migrate from SkuDetails to ProductDetails in Play Billing?

Replace all SkuDetails usages with ProductDetails, which supports multiple subscription offers per product. In PBL 8+, queryProductDetailsAsync returns a QueryProductDetailsResult object instead of a list, so the listener signature must be updated accordingly.

What compileSdk version does Play Billing Library 9 require?

Play Billing Library 9.0 requires compileSdk 35 or higher. PBL 7 and 8 require compileSdk 34 or higher, and PBL 8 also raises minSdkVersion to 23.

Why does my billing code break after upgrading to PBL 8?

PBL 8 removed querySkuDetailsAsync, queryPurchaseHistory, and the parameterless enablePendingPurchases(). It also changed the onProductDetailsResponse signature to accept QueryProductDetailsResult and introduced enableAutoServiceReconnection() to replace manual retry logic.

When should I use a stepped migration for Play Billing Library?

Use a stepped migration when your effective version is more than two major versions behind the target, such as v4 to v9. Upgrade two major versions at a time, running ./gradlew assembleDebug after each intermediate step to catch breaking changes early.