105
votes

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 real inapp 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("full", "Full v", Managed.MANAGED),

};

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 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 the item you've requested not available for purchase android message whenever I try to buy full, but if I try for example, android.test.purchased, it works absolutely fine.

The documentation for the item you've requested not available for purchase android 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 .

i am using same version of apk and i published inapp products also and activated apk also. but still i am facing same problem please help me ho to fix it.

Any thoughts would be appreciated!

18
you publish you product?Mohsin Naeem
the Google account you used for Merchant Account, is different from device account?Mohsin Naeem
Make sure the product you added on play store is showing status as "active"Ali
Make sure your testers have clicked the opt-in link...Pixel

18 Answers

191
votes

My experience on this error is:

  1. Make sure to upload the signed APK to developer console.

  2. Make sure to install the signed APK on your device not launch the app in the debugger.

  3. Make sure to create a test account in your developer console.

  4. Setup you testing account

    1. Make sure to sign in your device with your test account.
    2. In a case of closed alpha/beta testing, make sure you have added your test account to selected testers group, you can do this on the page of management your alpha/beta version.
    3. In a case of closed alpha/beta testing, make sure your testing account have accepted participation in testing of this application via special invite link
  5. Make sure to create in app billing in your developer console and finally activate the item from the console!!! (this is the one that got me after fully following google's tutorial)

  6. Make sure to set VersionCode and VersionName in the manifest to be the same as the version in the developer console (Alpha, Beta or Production. Drafts does not work anymore). @alexgophermix answer worked for me.

If you're looking for testing payments without actual money withdrawal, you need additionally add your testing account to another special list of accounts "Gmail accounts with testing access", you can find that on play account setting(not project!). On the page where you can see a list of your projects go to settings, and then on "Account details" page (scroll down, it's almost in the bottom of page) you will find the "Gmail accounts with testing access" list.

103
votes

Here are some things to check:

  1. You've created an apk and you've published it to the GooglePlay Dashboard in Alpha or Beta.
  2. The app in the GooglePlay Dashboard is NOT in Draft mode, but in Published (you'll need to make all the small circles with the check icon in them on the left side of the screen green before being able to publish).
  3. You've set another test account than the one that's "attached" to the GooglePlay Dashboard. You can do that by creating a Google+ group, add your test account to that group and specify the Google+ group in the GooglePlay Dashboard.
  4. The apk that you're using to test the purchase has the same version code, version name, and most importantly it's signed with the same keystore as the apk that you've published in the store.
  5. You wait a couple of hours between when you change something in the dashboard in order for the changes to propagate. It takes a couple of hours to do so.
  6. Make sure the sku value is a valid sku value (compare it with the one you've entered in the GP Dashboard).
  7. You try to purchase an already purchased item. Get the purchased items and display them in the log to see if so. If so, then consume that product or refund the money to your test account(you'll need to wait for the refund to propagate. It takes a couple of hours.)
  8. Make sure the Inapps are Active !

What did it for me, after 6 hours, was this last part:

  1. Make sure you're signedIn into google (in your browser) with the test account and you open this link (marked with the red) and you approve to become a tester !!!! http://i.stack.imgur.com/VSgAV.png

UPDATE

  1. If you're using flavors to build apks targeting different CPUs and you build for arm, armv7 and x86 and you upload them all to the store, remember to use one of them to test the inapps. If you use a "universal" build which contains all the cpu libraries (basically another build than what's on the store) it won't work.
45
votes

This happens when the product is Inactive on the Play Store, Activate the product and it should work fine.

25
votes

There is another possible cause for this error, which has almost driven me mad for a whole day until I found what was the problem: the apk version. If you are working with a local apk (correctly signed, correct key, correct product ids) with a version number higher than the one uploaded to the Play Store, you will also get this error.

Hope this helps someone

23
votes

This error comes when everything you done is perfect, you have used signed APK with the proper product id, but you have to note that the account that you are using might don't have proper valid credit card details.

So whenever you want to buy any product even with test account, that account should have valid credit details.

20
votes

Maybe I've been doing this wrong, but you will also get this error if the version you're testing on isn't on the Play Store as either Alpha, Beta or Production.

I often update my VersionCode and VersionName while still testing a new version (BEFORE uploading to Play Store) and then end up with this error when I go to test IAB specific features.

9
votes

For my case is need to go to get link from the APK tab's Opt-in URL. Open a browser and use the link. Then register as a tester in that page.

9
votes

you must accept to become tester

Release management -> app releases -> manage tester then open this link(Opt-in URL) with incognito mode to login tester account

enter image description here

5
votes

please check if your using same test account mail id or not

4
votes

Latest additions (2016/11):

  1. tester must ACCEPT testing request taken from the link taken from Developer Console (section: APK)

  2. app must be PUBLISHED: it is ok to publish in beta/alpha testing; INFO: if you hit "Publish" in Developer Console it will not publish the app on Production unless you propagate it to Production Tab (in section APK);

2
votes

If the Product status is in "Inactive", activate it. this Solved for me. Of-course Google takes a while to update

Also make sure the your test mail has been registered.

2
votes

While purchasing an in-app subscription, I had all the things from below list at the right place.

  1. Created signed apk and published to alpha channel

  2. Added tester email ids to license testing

  3. Added tester email ids to closed track alpha testing

  4. Opted in to be a tester

  5. Testing Id was different from developer account's id

  6. Was on android device and not on emulator

  7. Downloaded the app from play store

Still I was getting this error saying "Item you were looking for could not be found".

After wasting 2-3 days I found out that it was only working if some payment mode was setup in play store.

While most of the answers are related to old IAB purchase and I implemented new billing client API which is - implementation 'com.android.billingclient:billing:1.0', it was not easy to find out the solution.

If this is the same case for some one, adding a payment mode might help you to overcome this error. You need to add one even for testing it, however, it will not be charged for email ids added as a license testers.

1
votes

"Open Alpha Testing" or "Open Beta Testing" solved the problem for me, after trying all the methods suggested all over the internet.

Go to Android Developer Console -> Your app -> APK then opt in to use Open Alpha/Beta testing. Send the link provided to yourself or testers.

As long as they are logged in with that account on their Android device, they can test it.

Good luck

1
votes

I have faced with the same issue , The solution for me was uploading the current version of your app to the play store , If it is for testing then upload it to the Alpha or the Beta channel , I have done this and the error is gone and the pricing details is shown correctly ..

0
votes

There could be three possibilities :

  1. Save your APK on google play as Draft and don't forget to activate this and publish your products with unique Ids.
  2. Check your Ids are same as product Ids on google play.
  3. or check for Item types are same e.g. Managed in both Google Play and your Code.

If you are testing no need to publish the app. Just save it as a Draft. And Then wait for some time may be 2 to 3 hrs to activate this.

0
votes

In order to solve this problem, follow these steps:

  1. Create the product on Google play developer console.

  2. Save and set it to "Active".

  3. Upload the APK to Google play.

N.B. The in-app billing may not work until after 6 hours of creating your product in step 1.

0
votes

The top voted answer covers pretty much everything, but if you were as stupid as I was to rush through the App Release process in order to get on with testing IAPs, be sure to publish the app in the Play Store of the country you are testing in! Easy way to check this on device is to tap the 'download it on Google Play' link when opening the test opt-in URL. If you get an 'Item not found' error when attempting to open via the Google Play store then it's likely your app hasn't been published there. I ran into this issue because I was side-loading the signed app correctly via ADB and although IAPs will show up in the build, you will get this error when you try to purchase them.

0
votes

In my case, I had to add my email addresses to the following fields. enter image description here