102

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!

laxman
  • 1,608
  • 4
  • 14
  • 22

18 Answers18

187

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.

msangel
  • 8,829
  • 3
  • 43
  • 64
pinux
  • 3,952
  • 2
  • 15
  • 7
  • 6
    Always remember to test the application using signed build. +1 – Vamsi Challa Sep 08 '15 at 07:01
  • 37
    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. +1 – i.shadrin Dec 05 '15 at 08:58
  • 6
    In addition, make sure you test user has opted-in to the Alpha (if you are using that obv). It is not sufficient to add them to the License Testing. – ADB May 24 '16 at 17:03
  • 4
    Make sure that you approved to become a tester by opening Opt-in URL and using the test account. – bogumil Sep 16 '16 at 07:12
  • For me, I forgot to accept test user agreement, as I become valid tester I can able to test game build. – Siddharth Nov 16 '16 at 14:18
  • 1
    Version codes have to match, thanks for the heads up, saved a moment of sheer panic. – Meanman Nov 30 '16 at 19:09
  • I'll through another +1 behind the advice to have matching version codes. Saved more than one person a moment of sheer panic, it seems. – AutonomousApps Sep 15 '17 at 22:10
  • i have tested purchase with test account and i made 4 purchases every thing work great, but when i upload it to google play and download i see "the item you requested is not available for purchase", how?(item is active) – Pavel Poley Sep 27 '17 at 18:17
  • You don't really have to upload the apk to the play store. you just need the version number to be the same as the uploaded apk. I usually forget and increment the internal test version's number, and get this error. – Vlad Oct 19 '17 at 08:19
  • This is a life saver. – Ezio Dec 04 '17 at 12:38
  • thanks for the tip " "Gmail accounts with testing access" – Emil Apr 24 '18 at 15:47
  • Isn't it enough to sign debug version by `signingConfig signingConfigs.config` in the `build.gradle` and run it in the debugger? – Dmitry Sep 09 '18 at 00:04
  • The following helped me: `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`. – Dmitry Sep 09 '18 at 00:08
  • @i.shadrin Does the app have to be published too? I have unpublished it temporarily while I develop the in-app purchase feature. – daka Dec 29 '18 at 22:35
  • Hey @all I have tried everything and still showing me an error the item is no longer available Any Idea – Jigar Fumakiya Aug 10 '20 at 11:33
101

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.
AndreiBogdan
  • 9,331
  • 10
  • 46
  • 96
  • 14
    I got the same situation with you. all 1-8 is no problem but it's 9 that's the problem. Waste my whole day to find this. You are my life saver. – Paiboon Panusbordee Feb 16 '16 at 03:11
  • 2
    Yes, last part is most important, seems google changed the rules, it use to work without step 9, but now, for either close beta or open beta, you need to click the link. Thanks Man! – Siyuan Zhang Mar 02 '16 at 05:58
  • my problem was 4. installed apk's version code was not same as google play apk. Once i made same version it worked.this answer is valuable. – Thupten Mar 05 '16 at 21:29
  • I so much hate this "couple of hours" uncertainty! During this "couple of hours" my boss usually freaks out! Btw, if you have a manually installed APK you won't receive any update at all! And it's stupid that with own signed APK the IAB doesn't work. I guess we need to wait for the damn update to happen! – WindRider May 20 '16 at 13:49
  • For using your release key in debugging mode, for android studio, see http://stackoverflow.com/questions/16965058/where-the-debug-keystore-in-android-studio – VSB Aug 23 '16 at 22:23
  • you can do this in debug mode. Though, publisher can't purchase. So, use other gmail account. – dira Oct 01 '16 at 14:50
  • My problems were 3.) to set up closed beta testing, but problem continued until I did 9.) accepting myself with my test account as a tester. Tried and checked all other for hours. Basically all is said clearly in Googles guide, but I could not follow them ;-) – Reijo Korhonen Dec 28 '16 at 13:09
  • Google has made creating a new application with app-in purchases very complicated, because you must also publish it with all screenshots, descriptions, age limit validations etc. even if application is not ready. That takes a lot of time and some work is waste of time, because you must update those screenshots and description anyway with final versions until app is published. ;-( – Reijo Korhonen Dec 28 '16 at 13:17
  • Thanks for the solution. My problem was step 6. – ickyrr Jan 27 '17 at 00:40
  • Number 8 got me. The little dropdown box in the top right of the play store console isn't very noticeable. – Carson Holzheimer Sep 19 '17 at 02:11
  • I'm having some confusion in my product creation while upgread application version. Did we must required to create product while I'm upgrade my application version? I already created in-app product in my previous version of my application? – Chirag Solanki Oct 02 '17 at 06:48
  • F**n google, made simple things so dizzy, just like stupid apple! The key was you must accept this link on device the same device where you will test, not on any device linked to your google account! – Tertium Mar 04 '18 at 18:11
  • Open the link `https://play.google.com/apps/testing/...` helped me. Thanks! – Dmitry Sep 09 '18 at 00:07
  • How can we actually debug this though without signing? That possible? – Oliver Dixon Jul 22 '19 at 11:35
  • For me the missing step after following 1 through 10 was to actually download the app from Google Play once. After that I could upgrade the release-signed APK locally for debugging/testing and it continued working. – Frederik Apr 01 '20 at 12:47
  • Tried everything still showing me an error the item is no longer available. – Jigar Fumakiya Aug 10 '20 at 11:35
45

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

Kamran Ahmed
  • 7,171
  • 3
  • 27
  • 49
AnilPatel
  • 2,268
  • 1
  • 21
  • 39
24

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

DavidBVal
  • 349
  • 2
  • 5
  • This does not provide an answer to the question. Once you have sufficient [reputation](http://stackoverflow.com/help/whats-reputation) you will be able to [comment on any post](http://stackoverflow.com/help/privileges/comment); instead, [provide answers that don't require clarification from the asker](http://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-can-i-do-instead). - [From Review](/review/low-quality-posts/12424797) – tttony May 21 '16 at 00:52
  • 11
    The information of this answer is actually good to know and could be the right answer for some people like me – AlexioVay May 21 '16 at 13:25
  • 7
    @tttony I pointed out another cause of the error, I did not ask for any clarification. It's not an hypothesis or question, if you manually install an APK with a higher version number than the one published, in-app purchases *will* return this error. – DavidBVal May 21 '16 at 17:29
  • 2
    It was a very useful information to have. Thanks a lot for saving so much of my time. Thumbs up. – Aritra Roy Sep 22 '16 at 15:18
23

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.

Nirali
  • 12,335
  • 6
  • 35
  • 52
  • This answer that is both true and rare to find. So thanks a lot for going the extra mile and not adding yet another "activate your product" answer. – Don Sep 07 '15 at 15:34
  • Experiencing this just now as well. On relaunch, it *may* switch to a "Add a payment method" popup instead of the unavailable popup, but it may not. not sure why you get one or the other. – user107172 Oct 28 '20 at 00:20
20

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.

alexgophermix
  • 3,785
  • 5
  • 30
  • 54
  • 4
    And also allow at least 45-90 mins after uploading to the Play store for it to start working. – mm2001 Dec 26 '15 at 01:09
9

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.

Payne Chu
  • 423
  • 1
  • 5
  • 14
9

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

vuhung3990
  • 5,714
  • 1
  • 40
  • 42
5

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

laxman
  • 1,608
  • 4
  • 14
  • 22
  • ha my device login as another mail id,after i set testaccount mail id is primary id this problem is solved. – laxman Oct 30 '12 at 07:06
  • 3
    This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post - you can always comment on your own posts, and once you have sufficient [reputation](http://stackoverflow.com/faq#reputation) you will be able to [comment on any post](http://stackoverflow.com/privileges/comment). – Aziz Shaikh Oct 30 '12 at 07:21
  • i got this error when my device login as other than test account mail id(testaccount mail id specified in developer console under public key).if i set testaccount mail id as primary mail id of my device – laxman Nov 01 '12 at 11:53
4

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);

PerfectGamesOnline.com
  • 1,652
  • 1
  • 18
  • 26
2

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.

vijeth.ag
  • 379
  • 3
  • 7
2

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.

Community
  • 1
  • 1
Bee
  • 122
  • 15
1

"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

R_Paoa
  • 93
  • 1
  • 6
1

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 ..

Ameen Maheen
  • 2,427
  • 1
  • 24
  • 28
0

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.

Mohsin Naeem
  • 12,147
  • 3
  • 35
  • 52
URAndroid
  • 5,899
  • 5
  • 28
  • 39
0

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.

inspiredMichael
  • 352
  • 4
  • 8
0

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.

sprince
  • 171
  • 1
  • 5
0

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

Rajesh Jr.
  • 2,139
  • 5
  • 16
  • 34