In-app billing - the requested item is not available for purchase

I am working on studying billing in the application, but I had a problem with the example of Google billing in the application, dungeon.

I already installed the application, added my public key and changed API_VERSION to 1 in makeRequestBundle ().

I already exported and signed the application and uploaded it to Google Play and saved it as a draft with several images and activated apk. I also added both sword_001 and potion_001 as in-app purchases!

Then I installed the signed application on my phone, but when I try to buy either a sword or a potion, I get the error โ€œUnavailable itemโ€ that you requested is not available for purchase. ". I even tried on another device to make sure that itโ€™s not because the developer cannot buy their own products, and I get the same message on both devices.

What did I miss?

+8
android in-app-billing in-app-purchase
source share
9 answers

Well, I found a solution to my problem. I was not able to get Google to use the application to buy applications, but I was able to get this InApp Billing Tutorial to work using the steps I described in my original post.

If nothing else can help someone see all the steps that you need to follow to check out one example of billing in the app.

+1
source share

In the application, billing seems fraught with traps, but this is what I found to affect the availability of items for purchase, as well as the suitability of the application:

  • My code for what it was worth was heavily based on the Google Android demo, but I removed most of the complexity. I have a feeling that, having received it for work, the best result will be created by writing all this from scratch.
  • First I got the static test product identifiers.
  • Despite what the documentation says, it seemed to me that the subject of the purchase should be published even when using a test account. In any case, my work did not work, and I waited a long time to see if they would begin to work, as others suggested, they still did not.
  • You (I somehow) cannot publish the purchase item without publishing the application, so I downloaded and published the application, created the items for purchase, published them (big button at the bottom of the page), then disconnect the application again. This seems to leave published articles.
  • Before downloading, the application must be signed in the usual way (I did this by exporting from Eclipse), but what is not so obvious is that the application that you download to your mobile must also be signed in the same way - i.e. The (debugging) version downloaded to the Eclipse device โ€” starting or debugging โ€” will not work.
  • They also need the same version number, I think. Not 100% sure. If this is the case, unfortunately, it will mean that customers with older versions cannot buy anything without an update.
  • When the application is uploaded to Google, it may take several hours before it becomes available, and you will receive all the correct answers for billing in the application. Usually I find 1-2 hours.
  • I suspect that other comments on this question about whether you use a test gmail or googlemail account may be red herrings, but for what it's worth, my test account is gmail.
  • I found on the Internet a useful little note on how to change my main account on a mobile phone without doing a hard reset (and therefore losing everything), but unfortunately I could not find it again.
  • What I found is that there can be several Google accounts on the mobile phone, and then select the one that will be used on Google Play.

Hope this helps someone. I must say that this is a rather complicated system, with a small number of answers written, and I almost abandoned it.

+20
source share

Check out versionCode . It cannot be higher than the last published / unpublished version in any of your distribution channels (prod / beta / alpha).

+20
source share

My experience on this error:

  • Be sure to download the signed APK to the developer console.

  • Be sure to install the signed APK on your device, so as not to run the application in the debugger.

  • Be sure to create a test account in the developer console.

  • Be sure to log into your device using a test account.

  • Make sure that you created billing in the application in the developer's console and, finally, activate the item from the console !!! (I got this after fully studying the Google tutorial).

+6
source share

If your application is in closed alpha testing, you need to log in to your test account at the URL to select; https://play.google.com/apps/testing/{your.app.namespace}

+6
source share

Itโ€™s not enough just to download an unpublished apk project to test billing in the application. What you need to do is upload apk to the alpha or beta apk section on the developer's console. Then you need to publish it. If you also have an apk project in the APK Production section, be sure to delete it before publishing. Otherwise, it will be available to everyone.

Publishing an alpha or beta apk makes this apk available only to those testers that you specify / allow.

Here is the Google documentation on this:

https://support.google.com/googleplay/android-developer/answer/6062777?rd=1

+2
source share

Publishing the app did the trick for me (and left it published (!)). I had to wait a bit for Google to also update its database, as already mentioned elsewhere, changes to Google Play were not immediate.

+1
source share

There was also a problem for several days and was searched many times. I found this guy who said that he uninstalled the application and then reloaded the fix for his problem, and it really worked for me as well.

Try it, completely remove the application from the developer console. And re-launch the new signed apk and configure it again and again

+1
source share

Anecdotal addition: If you already have an existing application on the portal and you want to test the signed version, but do not upload it to the portal for distribution. Follow the usual steps to create a signed version, but use your latest version code, which is uploaded to the portal. You can do a quick and dirty purchase test (you canโ€™t download this version on the Google Play portal, but that means you need to finish the localized test (or even as a way to allow the download of side downloaded versions / tastes that use Google Play to set billing is legal.)

3 :)

+1
source share

All Articles