android-sdk icon indicating copy to clipboard operation
android-sdk copied to clipboard

Crash in QonversionBillingService when feature not supported

Open avalanchas opened this issue 2 years ago • 11 comments

Description

We see a crash in Production, which is affecting very few users currently, but those seem to always get it

Fatal Exception: java.lang.NoSuchMethodError: No direct method <init>(Lcom/qonversion/android/sdk/internal/billing/QonversionBillingService;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;)V in class Lcom/qonversion/android/sdk/internal/billing/QonversionBillingService$queryPurchases$1; or its super classes (declaration of 'com.qonversion.android.sdk.internal.billing.QonversionBillingService$queryPurchases$1' appears in /data/app/de.radio.android-2187wSnPvB8CwyFJP03q_A==/base.apk!classes3.dex)
       at com.qonversion.android.sdk.internal.billing.QonversionBillingService.queryPurchases(QonversionBillingService.kt:123)
       at com.qonversion.android.sdk.internal.QProductCenterManager.continueLaunchWithPurchasesInfo(QProductCenterManager.kt:729)
       at com.qonversion.android.sdk.internal.QProductCenterManager.access$calculatePurchasePermissionsLocally(QProductCenterManager.kt:51)
       at com.qonversion.android.sdk.internal.QProductCenterManager$launch$1.onSuccess(QProductCenterManager.kt:138)
       at com.qonversion.android.sdk.internal.AdvertisingProvider$init$1.run(AdvertisingProvider.kt:34)
       at java.lang.Thread.run(Thread.java:764)

There is a method signature missing in side the Qonversion class itself? Could this maybe be an issue with ProGuard?

How to reproduce

Unknown, seems to happen only in background? Important: From my logs I can see this happens only for users, who don't return OK from BillingClient.isFeatureSupported(BillingClient.FeatureType.SUBSCRIPTIONS) so I can probably fix this by not initializing the Qonversion SDK when I find this condition? It's probably debatable if the crash is "fine" knowing this, but even then I would argue it should be much clearer - in the Qonversion docs and in the crash trace

Versions, Devices

  • Currently only seen on Samsung, but this doesn't necessarily mean much, since Samsung users are by far the majority of our users
  • Currently only seen on Android 8.1 (API 27)
  • Qonversion SDK 4.2.0

avalanchas avatar Mar 23 '23 08:03 avalanchas

Hello. Thank you for the report. Could you please clarify which SDK version is used in the crashing app version?

SpertsyanKM avatar Mar 23 '23 09:03 SpertsyanKM

Thank you for the clarification. The issue looks very strange. It might not be connected with the BillingClient itself as there are no calls to it in the exception call stack or at the line where the crash occurs. Neither should this be related to ProGuard.

I'll try to investigate it deeper and will return as soon as I get any information.

SpertsyanKM avatar Mar 23 '23 09:03 SpertsyanKM

Something to add here: the devices on which this happens all look suspiciously similar, and the timings are also quite regular and match our uploads to the play store. I think this might only happen on some emulators which google uses during the vitals checks or something? I see that the AdvertisingProvider has some kind of ServiceConnection? So probably Google just tries to launch every service/activity/receiver it finds in the manifest, regardless of the state the code is in? Maybe you could set that service to exported=false?

avalanchas avatar Mar 27 '23 06:03 avalanchas

Hello, @avalanchas. Thanks for the additional information provided. We have opened a report with the engineers about this and created a task in our product backlog. We'll get back as soon as we get any information regarding this issue.

Thanks for your report!

pixelfoxxx avatar Mar 27 '23 08:03 pixelfoxxx

This issue is stale because it has been open 7 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar Apr 20 '23 01:04 github-actions[bot]

This issue was closed because it has been stalled for 5 days with no activity.

github-actions[bot] avatar Apr 25 '23 01:04 github-actions[bot]

sorry, I really don't want to be "that guy", but shouldn't this be kept open?

avalanchas avatar May 16 '23 07:05 avalanchas

Yes, you are right! Thank's for reminding us.

We've moved this issue to our backlog, so it isn't lost, but the issue still should be opened.

SpertsyanKM avatar May 16 '23 08:05 SpertsyanKM

This issue is stale because it has been open 7 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar May 24 '23 01:05 github-actions[bot]

This issue was closed because it has been stalled for 5 days with no activity.

github-actions[bot] avatar May 29 '23 02:05 github-actions[bot]

This issue is stale because it has been open 7 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar Jun 06 '23 02:06 github-actions[bot]

A long time has passed, and I'd like to clarify if this issue is still actual?

I dived deeper and was still unable to understand what happened in this crash. But it's not related to any exported services as you assumed. Stacktrace says that it's our regular initialization flow during which we try to fetch all the client purchases from Google Play to handle them, but it somehow crashes during lambda function initialization even before we access the Google Play Billing Library.

SpertsyanKM avatar Aug 01 '24 12:08 SpertsyanKM