Android IAB: "Error refreshing inventory (querying prices of items)" Developer Error
Asked Answered
L

5

15

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!

Landlocked answered 2/5, 2013 at 19:18 Comment(1)
I am experiencing the same issue with an app that has 25 in-apps. I haven't tried switching to a different user account yet but still that wouldn't make for a solution as it might happen to other users as well. Have you got any updates on this?Hereditary
I
20

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.

Ichabod answered 8/3, 2014 at 14:13 Comment(2)
This worked for me. Not every time queryInventoryAsync() is called the information is retrieved from Google servers. It also does it from the cache for the shake of speed.Exceptive
But we can not ask users to do so if this app is release to the play store.Iamb
H
15

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

Hereditary answered 30/5, 2013 at 10:31 Comment(5)
Splitting did solve my problem of querying large product list. In my case the limitation was 22 items. The error was returned from Play Service. So whe this limitation come from? Why only 20 or 22 items? Thanks.Spectroscope
@RusanovskiyArtem I have no idea where the limitation comes from but I contributed the patch back to Google so it should be part of the examples in one of the next releases.Hereditary
@ValerioSantinelli I have the same issue and tried out your patch but it doesn't work for me. Any idea why. I am still getting IabResult: Error refreshing inventory (querying prices of items). (response: 5:Developer Error)Jeavons
@Jeavons that's weird. I'm till using that same code in my production apps and it's working with 100+ IAPs. Have you got a test project that you can put on Github to let me clone it and see what's going on?Hereditary
@ValerioSantinelli It worked for me when I applied your method in a different way. I don't know why it didn't work the first time around but its working now. Thank youJeavons
F
0

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

Flemish answered 2/6, 2015 at 9:42 Comment(0)
S
0

I face same error but my issue is Date Time change

  • Go to setting and check your date time is accurate
Scrofulous answered 7/10, 2019 at 6:36 Comment(0)
A
0

for me it was the permission in android manifest

<uses-permission android:name="com.android.vending.BILLING" />

I use other markets so it was related to not having those market's permission as well

Ashlar answered 8/11, 2023 at 14:32 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.