Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempt to invoke virtual method 'boolean android.os.Handler.post(java.lang.Runnable)' Amazon SDK #408

Closed
5 tasks done
armandojimenez opened this issue Aug 1, 2022 · 18 comments
Labels
bug Something isn't working

Comments

@armandojimenez
Copy link

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?

@armandojimenez armandojimenez added the bug Something isn't working label Aug 1, 2022
@taquitos
Copy link
Contributor

taquitos commented Aug 1, 2022

Imported to SDKONCALL-75

@aboedo
Copy link
Member

aboedo commented Aug 2, 2022

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!

@armandojimenez
Copy link
Author

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)

@vegaro
Copy link
Contributor

vegaro commented Aug 2, 2022

@armandojimenez. I created a new issue #412 for that stacktrace. It looks like it's a different problem. Thanks for reporting

@taquitos
Copy link
Contributor

taquitos commented Aug 2, 2022

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!

@armandojimenez
Copy link
Author

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

@vegaro
Copy link
Contributor

vegaro commented Aug 5, 2022

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.

@vegaro
Copy link
Contributor

vegaro commented Aug 5, 2022

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

@stale
Copy link

stale bot commented Aug 12, 2022

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!

@stale stale bot added the status: waiting-for-reply Issues that are waiting for a reply label Aug 12, 2022
@armandojimenez
Copy link
Author

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?

Screen Shot 2022-08-16 at 9 46 07 AM

@stale stale bot removed the status: waiting-for-reply Issues that are waiting for a reply label Aug 16, 2022
@aboedo
Copy link
Member

aboedo commented Aug 23, 2022

🤔 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 😓

@armandojimenez
Copy link
Author

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:
Screen Shot 2022-08-23 at 4 49 01 PM
Screen Shot 2022-08-23 at 4 49 23 PM

@armandojimenez
Copy link
Author

armandojimenez commented Aug 23, 2022

Please verify this, also my monthly trials shows as converting first, then billing error and sub expiring, I don't understand amazon reporting:

Screen Shot 2022-08-23 at 6 18 44 PM

Screen Shot 2022-08-23 at 6 18 52 PM

Did they opt out of renewal then got a refund? why are not they getting the full month?

@aboedo
Copy link
Member

aboedo commented Aug 24, 2022

@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.

@aboedo
Copy link
Member

aboedo commented Aug 26, 2022

@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.

@armandojimenez
Copy link
Author

armandojimenez commented Aug 26, 2022

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
Screen Shot 2022-08-26 at 4 46 35 PM
.

@aboedo
Copy link
Member

aboedo commented Aug 29, 2022

@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!

@aboedo
Copy link
Member

aboedo commented Sep 6, 2022

I'm tentatively closing this one out but let us know if you run into any issues.

@aboedo aboedo closed this as completed Sep 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants