Solved

Android subscription crashes after test purchase

  • 28 August 2021
  • 2 replies
  • 119 views

Badge

Hello,

 

We are experiencing consistent crash after a test subscription purchase in our Android app.

The purchase first seemed to be successful, but after a short time, the first crash occurs and the crash message appears every 30 to 50 seconds from the background.
Also, re-launching the app also crashes after the purchase(the purchase might have triggered something).

 

Here is the crash log:

23:38:39.533 26296-26521/? E/AndroidRuntime: FATAL EXCEPTION: Thread-12

    Process: com.company.app, PID: 26296

    java.lang.NoSuchMethodError: No virtual method getSku()Ljava/lang/String; in class Lcom/android/billingclient/api/Purchase; or its super classes (declaration of 'com.android.billingclient.api.Purchase' appears in base.apk)

        at com.revenuecat.purchases.google.PurchaseDetailsConversionsKt.toRevenueCatPurchaseDetails(purchaseDetailsConversions.kt:16)

        at com.revenuecat.purchases.google.BillingWrapper.toMapOfGooglePurchaseWrapper(BillingWrapper.kt:401)

        at com.revenuecat.purchases.google.BillingWrapper.access$toMapOfGooglePurchaseWrapper(BillingWrapper.kt:51)

        at com.revenuecat.purchases.google.BillingWrapper$queryPurchases$1.invoke(BillingWrapper.kt:387)

        at com.revenuecat.purchases.google.BillingWrapper$queryPurchases$1.invoke(BillingWrapper.kt:51)

        at com.revenuecat.purchases.google.BillingWrapper.withConnectedClient(BillingWrapper.kt:565)

        at com.revenuecat.purchases.google.BillingWrapper.queryPurchases(BillingWrapper.kt:363)

        at com.revenuecat.purchases.Purchases$updatePendingPurchaseQueue$1.run(Purchases.kt:1677)

        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:459)

        at java.util.concurrent.FutureTask.run(FutureTask.java:266)

        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)

        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)

        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)

        at java.lang.Thread.run(Thread.java:764)

 

Our test device is Galaxy S8 using Android version 9.

Could this be a backward compatibility issue from RevenueCat SDK?

 

Thanks.

icon

Best answer by tina 31 August 2021, 22:30

View original

2 replies

Userlevel 3
Badge +8

Hello @Jinpyo Hong ,

What Purchases SDK + version are you currently running on? Are you using an emulator or a physical device? Are you able to reproduce this issue in our Native Android sample app? Crashes can also happen due to conflicts between RevenueCat and another plugin. If you are using other plugins, have you tried removing some to test if the crash still occurs?

Badge

Hello @Jinpyo Hong ,

What Purchases SDK + version are you currently running on? Are you using an emulator or a physical device? Are you able to reproduce this issue in our Native Android sample app? Crashes can also happen due to conflicts between RevenueCat and another plugin. If you are using other plugins, have you tried removing some to test if the crash still occurs?

 

Hello, thank you for your reply.

 

We are using the most recent SDK version 4.3.1 and ran it on physical devices.

As you have mentioned, it turned out that another dependency has caused the crash, so after removing the following, it works fine :)

dependencies {

    def billing_version = "4.0.0"

 

    implementation "com.android.billingclient:billing:$billing_version"

}

 

Thank you!

Reply