简体   繁体   中英

“The item you were attempting to purchase could not be found” when testing Android in-app purchase

I have a free app on Play Store that contains an active in-app product. When I try to test the purchase of that product I get this error message: “The item you were attempting to purchase could not be found” . Some months ago I was able to correctly test in-app purchase using a test account, even if it was on the same device on which the primary account is my developer account. Now I can't anymore with the new version. Here's what I've done:

  1. Compiled the signed APK and published it as an Alpha (not a draft).
  2. Added a test account in Developer Dashboard, under Settings.
  3. Installed the same APK I uploaded as Alpha version, on an Android device on which the only user account is the test account I set previously.
  4. After waiting more than 24 hours, I tried to make the in-app purchase, and got the error message: “The item you were attempting to purchase could not be found” .

So, I tried to add the test account to a Google Group that I set up as Alpha Testers group in Developer Console. I followed the procedure and, after uninstalling the APK from the device, I downloaded it from Google Play, since the test account is part of the testing group. Tried again to make the in-app purchase and got the same error.

What can I do? Why can't I test in-app purchase anymore?

I hope you can help me, because I don't know what to do anymore, and I would like to be sure that the in-app purchase works correctly before publishing the new version as Stable. Thank you in advance for your help.

I advice you to use a custom debug keystore to test your app, It should be more convenient. A custom keystore allows you to test using an application launched from Eclipse. So you will not have to upload your app each time you change something.

To create a custom debug keystore:

1) Copy your release keystore and rename it (For example iab.keystore)

2) Change the password of your keystore to "android => keytool -storepasswd -keystore iab.keystore

3) Change the alias of your keystore to "androiddebugkey" => keytool -changealias -keystore iab.keystore -alias currentalias -destalias androiddebugkey

PS: If you have forgotten the alias of your key: keytool -list -v -keystore iab.keystore

4) Change the password of your alias to "android" => keytool -keypasswd -keystore iab.keystore -alias androiddebugkey

You are now all set and can launch your app in debug from Eclipse.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM