Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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!

like image 603
gcl1 Avatar asked May 02 '13 19:05

gcl1


2 Answers

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.

like image 133
zinnuree Avatar answered Oct 17 '22 11:10

zinnuree


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

like image 21
Valerio Santinelli Avatar answered Oct 17 '22 12:10

Valerio Santinelli