Skip to content

Fix NoSuchMethodError: enablePendingPurchases() for Google Play Billing Library 7.x #6

@ptmkenny

Description

@ptmkenny

Problem

The plugin crashes on Android with the following error:

  java.lang.NoSuchMethodError: No virtual method
  enablePendingPurchases()Lcom/android/billingclient/api/BillingClient$Builder;
  in class Lcom/android/billingclient.api.BillingClient$Builder;
  at com.squareetlabs.capacitor.subscriptions.SubscriptionsPlugin.load(SubscriptionsPlugin.java:75)

Root Cause

The parameterless enablePendingPurchases() method was deprecated in Google Play Billing Library v7.0 and
removed in later versions. The plugin is using Billing Library v7.1.1 but still calling the old API.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions