question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

The sku was not found. Please fetch products first by calling getItems

See original GitHub issue

Version of react-native-iap

6.0.6

Version of react-native

0.64.1

Platforms you faced the error

Android

Actual behavior

Some users cannot make in-app purchases, the error they encountered is “the sku was not found. Please fetch products first by calling getItems”

The first thing i do in the app after initConnection() is to take the list of in-app purchases.

I don’t know how to reproduce the error, it does not seem related to a particular version of android or to a particular device

The error that some users receive:

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$13.run(RNIapModule.java:631)
        at com.dooboolab.RNIap.RNIapModule.ensureConnection(RNIapModule.java:91)
        at com.dooboolab.RNIap.RNIapModule.sendUnconsumedPurchases(RNIapModule.java:625)
        at com.dooboolab.RNIap.RNIapModule.startListening(RNIapModule.java:652)
        at java.lang.reflect.Method.invoke(Method.java:-2)
        at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:372)
        at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:151)
        at com.facebook.react.bridge.queue.NativeRunnable.run(NativeRunnable.java:-2)
        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:27)
        at android.os.Looper.loop(Looper.java:228)
        at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:226)
        at java.lang.Thread.run(Thread.java:919)

I know that getProducts definitely returns the products, because users can see the price of the purchase and I don’t save it in the app but I get it from getProducts

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:10 (1 by maintainers)

github_iconTop GitHub Comments

5reactions
pandya293commented, Nov 27, 2020

Yes, having same issue. Please post solution.

3reactions
TheHunscommented, Oct 16, 2020

@Ilario17 Having the same issue on android only, did you find a solution?

Read more comments on GitHub >

github_iconTop Results From Across the Web

react-native-iap android issue - in app purchase
I am getting The sku was not found. Please fetch products first by calling getItems. But I already getItems using RNIap.getSubscriptions .
Read more >
The sku was not found. Please fetch products first by calling ...
But I have another issue the item you were attempting to purchase could not be found How to solve it please? getItems =...
Read more >
InAppPurchases - Expo Documentation
Retrieves the product details (price, description, title, etc) for each item that you inputted in the Google Play Console and App Store Connect....
Read more >
react-native-iap-badoo - npm Package Health Analysis - Snyk
Please follow the readme what you get in returned variables when calling getItems and when ... getProducts, string[] Product IDs/skus, Promise<Product[]> ...
Read more >
React Native adlı Kategori yazıları - Ozcankrks.com
... 'react-native-iap'; en çok karşılaşılan hata olan "PROMISE_BUY_ITEM The sku was not found. Please fetch products first by calling getItems" hatasından ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found