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.
Android in-app billing error with android.test.purchased item
5.9k Views Asked by Victor Manuel Pineda Murcia At
3
There are 3 best solutions below
7

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