queryPurchases NullPointerException
See original GitHub issueVersion of react-native-iap
4.4.0
Version of react-native
0.61.5
Platforms you faced the error (IOS or Android or both?)
Android
Expected behavior
Doesn’t crash
Actual behavior
Crashes occasionally with
Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'com.android.billingclient.api.Purchase$PurchasesResult com.android.billingclient.api.BillingClient.queryPurchases(java.lang.String)' on a null object reference
at com.dooboolab.RNIap.RNIapModule$11.run(RNIapModule.java:575)
at com.dooboolab.RNIap.RNIapModule.ensureConnection(RNIapModule.java:91)
at com.dooboolab.RNIap.RNIapModule.sendUnconsumedPurchases(RNIapModule.java:569)
at com.dooboolab.RNIap.RNIapModule.startListening(RNIapModule.java:596)
at java.lang.reflect.Method.invoke(Method.java)
at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:371)
at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:150)
at com.facebook.react.bridge.queue.NativeRunnable.run(NativeRunnable.java)
at android.os.Handler.handleCallback(Handler.java:883)
at android.os.Handler.dispatchMessage(Handler.java:100)
at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:26)
at android.os.Looper.loop(Looper.java:237)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:225)
at java.lang.Thread.run(Thread.java:919)
Tested environment (Emulator? Real Device?)
Real Device in production
Steps to reproduce the behavior
Unable to reproduce. We possibly require a null check for BillingClient before calling queryPurchases for the devices that have an issue with it.
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (1 by maintainers)
Top Results From Across the Web
NullPointerException in IabHelper.queryPurchases
NullPointerException : Attempt to invoke interface method 'android.os. ... queryPurchases(IabHelper.java:878) at com.myapp.utils.IabHelper.
Read more >Google Play Billing Library 4 to 5 Migration Guide
This topic describes how to migrate from Google Play Billing Library 4 to Google Play Billing Library 5 and how to use new...
Read more >marketbilling - Google Code
ID Status Summary
201 New Mac Wi‑Fi Type‑Defect Priority‑Medium
200 New 34:cd:be:a5:0f: Type‑Defect Priority‑Medium
197 New l Type‑Defect Priority‑Medium
Read more >Android Question GooglePlayBilling - In App Purchases - B4X
NullPointerException : Attempt to invoke virtual method ... QueryPurchases("inapp")) Billing_PurchasesQueryCompleted (Result As BillingResult ...
Read more >Example usage for android.os Bundle getStringArrayList - Java2s.com
int queryPurchases(Inventory inv, String itemType) throws JSONException, RemoteException, NullPointerException { // Query purchases logDebug("Querying owned ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I am having the same issue on version 5.2.13 here is the crash log
Any updates here?