purchases-flutter
purchases-flutter copied to clipboard
Attempt to invoke virtual method 'boolean android.os.Handler.post(java.lang.Runnable)' Amazon SDK
- [x] I have updated Purchases SDK to the latest version
- [x] I have read the Contribution Guidelines
- [x] I have searched the Community
- [x] I have read docs.revenuecat.com
- [x] I have searched for existing Github issues
Hi, I just publised my app to the Amazon Appstore, using version 4.0.0-rc.1 I just received a crash in Sentry from a user trying to buy a subscription:
java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.os.Handler.post(java.lang.Runnable)' on a null object reference
at com.revenuecat.purchases.Purchases.dispatch(Purchases.kt:2)
at com.revenuecat.purchases.Purchases.handleErrorFetchingOfferings(Purchases.kt:9)
at com.revenuecat.purchases.Purchases.access$handleErrorFetchingOfferings(Purchases.kt:1)
at com.revenuecat.purchases.Purchases$fetchAndCacheOfferings$2.invoke(Purchases.kt:2)
at com.revenuecat.purchases.Purchases$fetchAndCacheOfferings$2.invoke(Purchases.kt:1)
at com.revenuecat.purchases.common.Backend$getOfferings$call$1.onError(Backend.kt:5)
at com.revenuecat.purchases.common.Dispatcher$AsyncCall.run(Dispatcher.kt:3)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:458)
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)
This is a fatal crash, does this mean that there was no offerings at the time of purchase? when this happens on my app version on Google Play, it never crashes, since I handle it on a try and catch and check for this offerings.current != null, but this is a native crash. Anyone knows the reason and how to handle this error?
Imported to SDKONCALL-75
Hi @armandojimenez, thanks for reporting!!
We recently received a report with a similar stacktrace and we made a fix that landed with 4.0.0-rc.1
.
We're digging into this one to see what's going on, we'll report back when we know more!
I just received another crash, should I open a new issue?
java.lang.NullPointerException: Attempt to read from field 'com.amazon.a.a.g.b com.amazon.a.a.n' on a null object reference
at com.amazon.a.a.c(AppstoreSDK.java:2)
at com.amazon.device.iap.internal.util.b.a(Logger.java:1)
at com.amazon.device.iap.internal.util.b.a(Logger.java:2)
at com.amazon.device.iap.internal.a.d.a(KiwiRequestHandler.java:7)
at com.amazon.device.iap.internal.d.a(PurchasingManager.java:26)
at com.amazon.device.iap.PurchasingService.getPurchaseUpdates(PurchasingService.java:1)
at com.revenuecat.purchases.amazon.DefaultPurchasingServiceProvider.getPurchaseUpdates(DefaultPurchasingServiceProvider.kt:1)
at com.revenuecat.purchases.amazon.handler.PurchaseUpdatesHandler.queryPurchases(PurchaseUpdatesHandler.kt:1)
at com.revenuecat.purchases.amazon.AmazonBilling$queryPurchases$1.invoke(AmazonBilling.kt:5)
at com.revenuecat.purchases.amazon.AmazonBilling$queryPurchases$1.invoke(AmazonBilling.kt:1)
at com.revenuecat.purchases.amazon.AmazonBilling$executePendingRequests$1$1.run(AmazonBilling.kt:1)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:211)
at android.app.ActivityThread.main(ActivityThread.java:6740)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
@armandojimenez. I created a new issue #412 for that stacktrace. It looks like it's a different problem. Thanks for reporting
Imported to SDKONCALL-75
Heya, sorry for the confusion, we import all issues into our internal tracker which then gives us a central location of alerts. That way we can respond faster. I'm going to update the messaging so it's clearer that we're on the case and will help as soon as we can!
Hey! checking my commit history, I see I released the app pointing to this app version:
purchases_flutter:
git:
url: https://github.com/RevenueCat/purchases-flutter
ref: release/4.0.0
Maybe this is already fixed with 4.0.0-rc.1? I am preparing a new app release using 4.0.0-rc.2
Oh! It's possible this is fixed in rc.1 yes. Do you mind making that release with rc.2 and report back if it looks like it's fixed?
I am not sure what release/4.0.0
is pointing, since there's no tag or branch named like that at the moment in the repository.
Btw, we just released https://github.com/RevenueCat/purchases-flutter/releases/tag/4.0.0, which is technically the same as rc2. In case you want to update directly to 4.0.0
This issue has been automatically marked as stale due to inactivity. It will be closed if no further activity occurs. Please reach out if you have additional information to help us investigate further!
I have a customer that started a trial, and the trial still has not converted, was supposed to convert 2 days ago. It does not show billing error or nothing. Does this have to do with the package?

🤔 That seems like a separate issue.
Have you noticed this happening with multiple users or just the one? Did that user eventually convert? Sorry for the delay in the reply 😓
Multiple in 2 apps, only one converted and was a monthly option. yearly options don't convert. Here 2 customers that still has not converted after trial:
Please verify this, also my monthly trials shows as converting first, then billing error and sub expiring, I don't understand amazon reporting:


Did they opt out of renewal then got a refund? why are not they getting the full month?
@armandojimenez I passed your questions along to the team who worked the most on Amazon support, I'll let you know as soon as I hear back to see if they've seen this before.
@armandojimenez It looks like the events were generated, but after the time you checked. Currently our receipt refreshers for Amazon update once a day, meaning that depending on the timing when you check, it may take up to 47 hours 59 mins to see the events reflected in the dashboard.
We have a few things in the works that will improve this timing, but in the meantime, please allow for up to 48 hours for events to show up.
Checked again and still the same, nothing changed, still no new info about if the user converted, if it was charged or refunded. It was supposed to convert 12 days ago, that's more than 48 hours
.
@armandojimenez thanks for your patience on this one! Thanks to your report, we were able to find a bug in Amazon's receipt where it might have an old expiration date even after refreshing. We've deployed a workaround for this on our side, so hopefully this should be solved automatically the next time our receipt refreshers pick up these receipts.
Let us know if you continue to see this kind of thing!
I'm tentatively closing this one out but let us know if you run into any issues.