libgdx/gdx-pay

Crash related to Google Billing Library

vminc opened this issue · 4 comments

vminc commented

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

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

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);

Did you adapt the proguard configuration?

Closed because no answer.