I'm trying to test my in app purchase flow with the fake item android.test.purchased, from android documentation. I'm not able to test this flow, just when I launch it, I get this error: "The item you requested is not available for purchase". I have the permission in my manifest and I don't understand why I get this error with the fake item android.test.purchased.
-
having the same issue, It was working just fine for me yesterday, I setup the server side validation and wanted to test. ran into problems with my product IDs so i checked the static ones again and they gave the same errors. – JStephen Jan 23 '17 at 20:18
-
Any solution? I am also using static productId to test, but always get `Unexpected response code 500 for https://android.clients.google.com/fdfe/ees/acquire` and `df-dferh-01` errors. Searching hours now, but all useless info only. – Zoli Dec 14 '17 at 17:10
-
**In my case:** I consume purchased item and it worked fine. – AiOsN May 09 '18 at 08:18
3 Answers
Here is the list of requirements for the Google IAB testing.
Prerequisites:
- AndroidManifest must include "com.android.vending.BILLING" permission.
- APK is built in release mode.
- APK is signed with the release certificate(s).
- APK is uploaded to alpha/beta distribution channel (previously - as a draft) to the developer console at least once. (takes some time ~2h-24h).
- IAB products are published and their status set to active.
- Test account(s) is added in developer console.
Testing requirements:
- Test APK has the same versionCode as the one uploaded to developer console.
- Test APK is signed with the same certificate(s) as the one uploaded to dev.console.
- Test account (not developer) - is the main account on the device.
- Test account is opted-in as a tester and it's linked to a valid payment method.

- 1
- 1

- 588
- 5
- 19
-
1I know this requisites and I don't buying any production/test items, I'm using google play static responses: https://developer.android.com/google/play/billing/billing_testing.html#billing-testing-static – Victor Manuel Pineda Murcia Dec 29 '16 at 12:09
-
-
1You don't need to sign your apk file to test static responses. – Victor Manuel Pineda Murcia Dec 29 '16 at 12:22
-
-
Yes, I do. I have updated my question with the new error message I get after increase the versionCode. – Victor Manuel Pineda Murcia Dec 29 '16 at 12:34
-
-
2
To test in-app products or make in-app purchases in your alpha or beta channel app, each tester needs to opt-in to your app’s alpha or beta test. On your test’s opt-in URL, your testers will get an explanation of what it means to be a tester and a link to opt-in.
The most current version of the Google Play application must be installed on the device.
Ref: https://stackoverflow.com/a/22469253/3758024
https://stackoverflow.com/a/11076056/3758024
https://developer.android.com/google/play/billing/billing_testing.html
-
I am not doing any alpha or beta app purchase, I'm using in app static responses: https://developer.android.com/google/play/billing/billing_testing.html#billing-testing-static – Victor Manuel Pineda Murcia Dec 29 '16 at 12:09
-
You have to publish your app to Alpha environment to test In-App Purchases – Gopal Dec 29 '16 at 12:15
-
I know, and I have already done it. But static responses doesn't require to publish the app in alpha nor beta channel. – Victor Manuel Pineda Murcia Dec 29 '16 at 12:22
-
'versionCode' of your current apk need to be <= 'versionCode' of published apk. – Gopal Dec 29 '16 at 12:27
-
Thanks, I have checked it and after change that, I get another error ("the item you requested is not available for purchase"). It's very strange because it's a fake item and it's suppossed to be always available. I'll investigate it. – Victor Manuel Pineda Murcia Dec 29 '16 at 12:33
I was with the same problem and fixed listing the "android.test.purchased" ID in the IAP activate list. I know Google says that you do not need to list the IAP ID with static responses but, in my case, after I listed the ID "android.test.purchase" and activated I get success in my tests

- 1