Skip to content

Library not compatible with the newest Google Billing Library #1289

@michalgwo

Description

@michalgwo

Describe the bug

In the recent release of Google Play Billing Library, they removed enablePendingPurchases() method. enablePendingPurchases(PendingPurchaseParams params) should be used instead.

Because of that, when I updated the Google Billing Library to 8.0.0, the app crashes on

Branch.getInstance().logEventWithPurchase(this, purchase)
Process: com.app, PID: 30442
java.lang.NoSuchMethodError: No virtual method enablePendingPurchases()Lcom/android/billingclient/api/BillingClient$Builder; in class Lcom/android/billingclient/api/BillingClient$Builder; or its super classes (declaration of 'com.android.billingclient.api.BillingClient$Builder' appears in /data/app/~~_ukJYLwtEshuXh4rVA9zJw==/com.app-8Sxlyxgdsj0BNFEEBGDPeg==/base.apk!classes26.dex)
	at io.branch.referral.BillingGooglePlay$Companion.getInstance(BillingGooglePlay.kt:25)
	at io.branch.referral.Branch.logEventWithPurchase(Branch.java:2658)
	at com.app.processPurchaseList(AndroidBillingDataSource.kt:197)
	at com.app.handleRefreshPurchasesResult(AndroidBillingDataSource.kt:161)
	at com.app.refreshPurchases(AndroidBillingDataSource.kt:155)
	at com.app$refreshPurchases$1.invokeSuspend(Unknown Source:14)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:100)
	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:586)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:829)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:717)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:704)
	Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@5b187dc, Dispatchers.Default]

Steps to reproduce

  1. Use Google Billing Library 8.0.0
  2. run Branch.getInstance().logEventWithPurchase(this, purchase)

Expected behavior

Not crashing

SDK Version

5.19.0

Make and Model

Xiaomi Redmi Note 13

OS

Android 14

Additional Information/Context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions