Android IAB: “Error refreshing inventory (querying

2020-08-09 10:57发布

问题:

I've been setting up Android in app billing v3, using the IABHelper class, and following the example code provided by Google. I have it mostly working all the way through purchase (with signed apk and real credit card charge).

However, in the course of testing today I started to get a new error in my QueryInventoryFinishedListener from the queryInventoryAsync() method:

IABResult message: "Error refreshing inventory (querying prices of items)"
IABResult response: 5:Developer Error

Weird thing #1 is that this occurs after the onIabSetupFinished() callback returns (with the customary "Hooray" message). Weird thing #2 is that I can subsequently & successfully process an in app purchase (using the launchPurchaseFlow() method).

I found a patch here that addresses the same symptoms I'm experiencing, but it didn't work for me.

I've tried using different devices, using different gmail accounts, and building a new product from scratch. I even getting the error on earlier versions of my app that ran correctly (what?!).

My question is: Why can't I query the product inventory, even after IABHelper has confirmed the set up was successful? What could be causing this error, and how can I fix it?

Thank you for any insight.

UPDATE

I was able to get the inventory query transactions to work again by ditching the account I was testing with, and switching to a new account. No code change.

My tentative conclusion is that something got corrupted in the user account I was using (?). During testing, I had hit it pretty hard with a lot of purchases of different in-app products -- but I still need to find out what happened, and make sure this doesn't happen to any of my users.

Please let me know if you have any experience with this. Thanks!

回答1:

We had the same problem in one of our apps under test mode. Later, we figured out that, we had to clear the Cache of the Google Play Store app.

So you can try this -

  1. Go your device's Settings menu.
  2. Go to Applications (may also be labeled Application Manager).
  3. Tab over to All Applications.
  4. Search for and open the Google Play Store app. Tap on it, application settings will show
  5. Tap on Clear Data and Clear Cache.

Now go back to your app and try to load inventory. It solved our problem.



回答2:

I found by trial and error that if you query more than 20 items at once, it will fail with this error.

I submitted a patch for IabHelper.java that splits the list of SKUs into packets of 20 items each and does the query.

You can grab it there: https://code.google.com/p/marketbilling/issues/detail?id=123



回答3:

I have the same issue with this log :

"InAppBillingManager.getSkuDetails: Input Error: skusBundle array associated with key ITEM_ID_LIST cannot contain more than 20 items."

this note had mentioned in IInAppBillingService.aidl file, see the documentation of the method getSkuDetails(..) .

So you should make the same process for each 20 items every time



回答4:

I face same error but my issue is Date Time change

  • Go to setting and check your date time is accurate