libgdx / gdx-pay

A libGDX cross-platform API for InApp purchasing.
Apache License 2.0
225 stars 83 forks source link

Crash related to Google Billing Library #208

Closed vminc closed 4 years ago

vminc commented 4 years ago

We got these crashs for the SHIELD device. How can this issue be resolved?

Fatal Exception: java.lang.NoSuchMethodError No static method a(Landroid/os/IBinder;)Lcom/android/vending/billing/IInAppBillingService; in class Lcom/android/vending/billing/IInAppBillingService$Stub; or its super classes (declaration of 'com.android.vending.billing.IInAppBillingService$Stub' appears in /system/framework/framework.jar:classes2.dex)

vminc commented 4 years ago

Stack trace

com.android.billingclient.api.BillingClientImpl$BillingServiceConnection.onServiceConnected (BillingClientImpl.java:822) android.app.LoadedApk$ServiceDispatcher.doConnected (LoadedApk.java:1634) android.app.LoadedApk$ServiceDispatcher$RunConnection.run (LoadedApk.java:1663) android.os.Handler.handleCallback (Handler.java:789) android.os.Handler.dispatchMessage (Handler.java:98) android.os.Looper.loop (Looper.java:164) android.app.ActivityThread.main (ActivityThread.java:6565) java.lang.reflect.Method.invoke (Method.java) com.android.internal.os.Zygote$MethodAndArgsCaller.run (Zygote.java:240) com.android.internal.os.ZygoteInit.main (ZygoteInit.java:767)

vminc commented 4 years ago

This is the relevant codepath in Android Billing library where it crashes.

@Override public void onServiceConnected(ComponentName name, IBinder service) { BillingHelper.logVerbose(TAG, "Billing service connected.");

  mService = IInAppBillingService.Stub.asInterface(service); // Line 822 where it crashes
  String packageName = mApplicationContext.getPackageName();
  mSubscriptionsSupported = false;
  mSubscriptionUpdateSupported = false;
  mIABv6Supported = false;
  // The code below tries to figure out, which IAB API version and features are supported by
  // current client (Play Store app on this device).
  // First, it checks for IABv6 with subscriptions to avoid extra queries for most of the
  // clients.
  // Second, it checks if IABv6 is supported for in-app only items.
  // Third, it checks for IABv5 for subscription only (since only getBuyIntentToReplaceSku was
  // added during that release).
  // And finally it checks for IABv3 for both subscriptions and inapp items.
  try {
    // Check for in-app billing API v6 support with subscriptions. This is needed for
    // getPurchaseHistory and getBuyIntentExtraParams methods.
    @BillingResponse
    int response = mService.isBillingSupported(/* apiVersion */ 6, packageName, SkuType.SUBS);
MrStahlfelge commented 4 years ago

Did you adapt the proguard configuration?

MrStahlfelge commented 4 years ago

Closed because no answer.