-
Notifications
You must be signed in to change notification settings - Fork 83
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
PurchaseManagerGoogleBilling: Problem restoring purchases unless entire history of IAPs are listed in PurchaseManagerConfig, even if IAP does not exist in Play Console #183
Comments
Thank you. This can be fixed by adding a null-check on config.getOffer(purchase.getSku()) |
I'm not sure that my errors concerns this issue. But I'll leave it here, maybe the error is the same, there was still no time to figure it out. java.lang.NullPointerException:
at com.badlogic.gdx.pay.android.googlebilling.PurchaseManagerGoogleBilling.access$600 (PurchaseManagerGoogleBilling.java)
or .setInstalledAndNotifyObserver (PurchaseManagerGoogleBilling.java)
at com.badlogic.gdx.pay.android.googlebilling.PurchaseManagerGoogleBilling.access$200 (PurchaseManagerGoogleBilling.java)
or .purchaseRestore (PurchaseManagerGoogleBilling.java)
at com.badlogic.gdx.pay.android.googlebilling.PurchaseManagerGoogleBilling$3.onSkuDetailsResponse (PurchaseManagerGoogleBilling.java)
at com.android.billingclient.api.BillingClientImpl$2$1.run (BillingClientImpl.java)
at android.os.Handler.handleCallback (Handler.java:761)
at android.os.Handler.dispatchMessage (Handler.java:98)
at android.os.Looper.loop (Looper.java:156)
at android.app.ActivityThread.main (ActivityThread.java:6623)
at java.lang.reflect.Method.invoke (Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:942)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:832) java.lang.NullPointerException:
at com.badlogic.gdx.pay.android.googlebilling.PurchaseManagerGoogleBilling.e (PurchaseManagerGoogleBilling.java:2)
at com.badlogic.gdx.pay.android.googlebilling.PurchaseManagerGoogleBilling.access$100 (PurchaseManagerGoogleBilling.java)
or .dispose (PurchaseManagerGoogleBilling.java)
or .purchase (PurchaseManagerGoogleBilling.java)
at com.badlogic.gdx.pay.android.googlebilling.PurchaseManagerGoogleBilling$1.run (PurchaseManagerGoogleBilling.java:27)
at com.badlogic.gdx.pay.android.googlebilling.PurchaseManagerGoogleBilling$2.a (PurchaseManagerGoogleBilling.java:40)
at com.android.billingclient.api.BillingClientImpl$BillingServiceConnection.onServiceConnected (BillingClientImpl.java:228)
at android.app.LoadedApk$ServiceDispatcher.doConnected (LoadedApk.java:1658)
at android.app.LoadedApk$ServiceDispatcher$RunConnection.run (LoadedApk.java:1687)
at android.os.Handler.handleCallback (Handler.java:789)
at android.os.Handler.dispatchMessage (Handler.java:98)
at android.os.Looper.loop (Looper.java:164)
at android.app.ActivityThread.main (ActivityThread.java:6944)
at java.lang.reflect.Method.invoke (Method.java)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run (Zygote.java:327)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1374) java.lang.NullPointerException:
at com.badlogic.gdx.pay.android.googlebilling.PurchaseManagerGoogleBilling$3.onSkuDetailsResponse (PurchaseManagerGoogleBilling.java)
at com.android.billingclient.api.BillingClientImpl$2$1.run (BillingClientImpl.java)
at android.os.Handler.handleCallback (Handler.java:751)
at android.os.Handler.dispatchMessage (Handler.java:95)
at android.os.Looper.loop (Looper.java:154)
at android.app.ActivityThread.main (ActivityThread.java:6780)
at java.lang.reflect.Method.invoke (Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:1500)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1390) java.lang.NullPointerException:
at com.prozhar.math.gdx_pay.PurchaseManagerGoogleBilling.access$300 (PurchaseManagerGoogleBilling.java)
or .fetchOfferDetails (PurchaseManagerGoogleBilling.java)
at com.prozhar.math.gdx_pay.PurchaseManagerGoogleBilling.access$100 (PurchaseManagerGoogleBilling.java)
or .purchase (PurchaseManagerGoogleBilling.java)
or .purchaseRestore (PurchaseManagerGoogleBilling.java)
at com.prozhar.math.gdx_pay.PurchaseManagerGoogleBilling$1.run (PurchaseManagerGoogleBilling.java)
at com.prozhar.math.gdx_pay.PurchaseManagerGoogleBilling$2.onBillingServiceDisconnected (PurchaseManagerGoogleBilling.java)
or .onBillingSetupFinished (PurchaseManagerGoogleBilling.java)
at com.android.billingclient.api.BillingClientImpl$BillingServiceConnection.onServiceConnected (BillingClientImpl.java)
at android.app.LoadedApk$ServiceDispatcher.doConnected (LoadedApk.java:1208)
at android.app.LoadedApk$ServiceDispatcher$RunConnection.run (LoadedApk.java:1225)
at android.os.Handler.handleCallback (Handler.java:739)
at android.os.Handler.dispatchMessage (Handler.java:95)
at android.os.Looper.loop (Looper.java:135)
at android.app.ActivityThread.main (ActivityThread.java:5268)
at java.lang.reflect.Method.invoke (Method.java)
at java.lang.reflect.Method.invoke (Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:902)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:697) |
No, it is not the same error. It looks like you use the PurchaseManager after disposing. |
Hi @MrStahlfelge I've been wanting to test your pull request but I've been getting an error with gradle. I forked your repo and am trying to use Jitpack to include the sub repos.
Haven't tried including libs this way before. What can I do here? |
Hi, I can't help you how Jitpack handles things. You can test by building the snapshot yourself: clone the repo on your machine and build the snapshot locally with |
GoogleBilling #183 fix NPE if a purchased item is not available any more
Merged the fix, but snapshot is not updated. When this is done, this issue can be closed. |
Fix is now published in 0.11.4-SNAPSHOT |
Confirmed working on my end, thanks. |
Problem
Using PurchaseManagerGoogleBilling I'm running into an issue while I'm trying to test purchases of entitlements.
I created an IAP in the play console and then was able to successfully purchase in the game. However, entitlements cannot be purchased again, and there is no way to delete history of in-app purchases to do so (apparently some people have this option in the play store, but this is not the case for me).
I want to be able to test a purchase of an IAP again, but the only way I can is if I create another IAP in the Play Console. Now I'm ending up with a chunk of code as follows because deleting any line causes a NullPointerException.
Error
A NullPointerException is thrown unless I list the complete history of every entitlement that has been purchased for this app, even if that IAP does not exist in the Play Console anymore. I'm done with testing and want the code below, but this causes a crash.
The code crashes on the first line of this code block in PurchaseManagerGoogleBilling.java
The text was updated successfully, but these errors were encountered: