Skip to content Skip to sidebar Skip to footer

Android - Testing Billing Purchase With Real Item Id Gives Error: Item Not Found

I have a situation where I tested on a test device with the item id: android.test.purchased And things worked. Then once I changed that string with the real item id, I started get

Solution 1:

Since this is a subscription I believe you must replace this line:

mHelper.launchPurchaseFlow(SubscribeIntroActivity.this, SUBSCRIBE_SKU, RC_REQUEST, mPurchaseFinishedListener);

with this one:

mHelper.launchSubscriptionPurchaseFlow(SubscribeIntroActivity.this, SUBSCRIBE_SKU, RC_REQUEST, mPurchaseFinishedListener);

At least this is what I use in my code and I have successfully tested it.

Solution 2:

I don't think the new in-app billing version 3 currently supports subscriptions. I could be wrong, but I haven't seen any mention of subscriptions in the sample code or documentation, so that could be why you're receiving the the "Item not found" error.

In general, to test purchasing a real item, you need to upload a version of your app to the developer console (but you don't need to publish it), and you have to be using the same (signed) version to test with. It also takes Google Play some time to process/propagate newly added items...so sometimes you unfortunately just need to wait. Check out developer.android.com/training/in-app-billing/test-iab-app.html if you haven't already.

Solution 3:

One more thing to know. Purchases doesn't appear immediately. You can test them after 2-3 hours from moment, when you publish it.

Sorry for my English =)

Solution 4:

There's a limit of 20 items per request. Even if you split them in groups of 20 items, it still does

skuList.addAll(inv.getAllOwnedSkus(itemType));

which guarantees an error if number_of_owned_items + number_of_queried_items is greater than 20, in particular, if number_of_owned_items is 21.

Now I understand why someone suggested rewriting the code from scratch from the very beginning.

Post a Comment for "Android - Testing Billing Purchase With Real Item Id Gives Error: Item Not Found"