Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android in-app purchase - RESULT_ITEM_UNAVAILABLE

Tags:

android

I'm trying to integrate Android Market in-app purchases into my app, but unfortunately coming across an annoying error every time I try to purchase a test product.

I've taken the sample application (Dungeons) and added it to my app. I've updated the Public Key and also updated the list of products to the following:

/** An array of product list entries for the products that can be purchased. */
private static final CatalogEntry[] CATALOG = new CatalogEntry[] {
    new CatalogEntry("lemonstorm.huru.full", "Full v", Managed.MANAGED),
    new CatalogEntry("android.test.purchased", "purchased",Managed.UNMANAGED),
    new CatalogEntry("android.test.canceled", "cancelled",Managed.UNMANAGED),
    new CatalogEntry("android.test.refunded", "Refunded",Managed.UNMANAGED),
    new CatalogEntry("android.test.item_unavailable", "unavailable",Managed.UNMANAGED)
};

I've exported the application using Eclipse, and installed it on my phone and also uploaded it to the Android Market website. Also on the Android Market website I've added lemonstorm.huru.full as an in-app purchase and published it.

I've also added my googlemail account as a testing account (that is the one I'm signed into on my phone).

When I run the application on my phone I get a RESULT_ITEM_UNAVAILABLE message whenever I try to buy lemonstorm.huru.full, but if I try for example, android.test.purchased, it works absolutely fine.

The documentation for RESULT_ITEM_UNAVAILABLE states the following:

Indicates that Android Market cannot find the requested item in the application's product list. This can happen if the product ID is misspelled in your REQUEST_PURCHASE request or if an item is unpublished in the application's product list.

The product ID is definetely the same, it's definetely published and the request must be going through ok as it's the sample application and it worked for android.test.purchased

Any thoughts would be appreciated!

like image 257
RichW Avatar asked May 26 '11 09:05

RichW


2 Answers

I had this same problem. After I published the application, the products were found. Looks like a bug in Google's test accounts(?)

like image 74
beetstra Avatar answered Oct 29 '22 19:10

beetstra


I've had the same issue. I was playing with Dungeons sample and missed that sword_001 and potion_001 products must be "Published". The problem for me was that they where just saved and remained "Unpublished".

To solve it I've just edited products and pressed Publish button for both. Now I can buy both from the sample app.

like image 43
Denys Nikolayenko Avatar answered Oct 29 '22 20:10

Denys Nikolayenko