GooglePlay: The item you requested is not available for purchase
Asked Answered
A

5

8

I am getting the following from the Google Play IAB API;

The item you requested is not available for purchase

I have however successfully tested against static responses, and in addition, the following code returns myProductId in the list of available products;

ArrayList<String> skuList = new ArrayList<String> ();
skuList.add("myProductId");
Bundle querySkus = new Bundle();
querySkus.putStringArrayList("ITEM_ID_LIST", skuList);
Bundle skuDetails = service.getSkuDetails(3, activity.getPackageName(), "inapp", querySkus);

In addition I have;

  • Published a beta APK
  • Added a test user to the beta and opted in via the URL
  • Logged on the device with the test user (gmail account)
  • Pushed a signed APK with the same versioncode to the device
  • Activated the product

The purchasing code I am using is;

Bundle buyIntentBundle = service.getBuyIntent(3, activity.getPackageName(), "myProductId", "inapp", "payload");
PendingIntent pendingIntent = buyIntentBundle.getParcelable("BUY_INTENT");
activity.startIntentSenderForResult(pendingIntent.getIntentSender(), 1001, new Intent(), Integer.valueOf(0), Integer.valueOf(0), Integer.valueOf(0));

Finally, logcat shows the following;

D/Finsky: [1] PurchaseFragment.onStateChange: Error: PurchaseError{type=3 subtype=0}
D/Finsky: [1] PurchaseFragment.onStateChange: Purchase failed: PurchaseError{type=3 subtype=0}

Whilst there are other questions related to this issue, none of them solve it for me;

  1. the item you requested is not available for purchase
    • Product is active
  2. The item you have requested is not available for purchase
    • Testing with Static Responses is successful for product android.test.purchased
  3. Android In App Purchase “Item that you have requested is not available for purchase” Error
    • Test user logged in
Ashtonashtonunderlyne answered 6/3, 2016 at 23:29 Comment(6)
@SreeReddyMenon got excited there for a moment, but alas that resulted in the same issue. The docs say regarding developerPayload: The developerPayload String is used to specify any additional arguments that you want Google Play to send back along with the purchase information.Ashtonashtonunderlyne
may be different version code?Vanettavang
@SreeReddyMenon double checked: versioncode is same on both google play beta and in the source I deploy to the device.Ashtonashtonunderlyne
apk is not from playstore ? You can install app from playstore right via opt-in URL ?Vanettavang
I am not sure ! But It should be.. please try once !Vanettavang
Let us continue this discussion in chat.Ashtonashtonunderlyne
A
6

12 hours after my last test this was mysteriously working. The symptoms were:

  • Purchase unavailable if the application was installed to the device via ADB (release & signed)
  • Purchase available as normal if the application was installed via Google Play (download)

What exactly fixed this i'm unsure. Prior to waiting 12 hours I;

  • Switched from using IInAppBillingService directly to using Google's IABHelper. The immediate effect was still product unavailable for purchase, however the text was now displayed in red rather than black (what?) and the DFinsky error changed to subtype 4; PurchaseError{type=3 subtype=4}. I also note that i was not using base64EncodedKey when using IInAppBillingService directly.
  • Switched to multiple APKs (probably red-herring)
  • Started an alpha test (was previously using a beta test only)
  • Created a new gmail account and added it to testers

Even after all these changes, the issue was still occurring, so I went to bed, woke up this morning and with no further changes it just worked. FML.

Ashtonashtonunderlyne answered 10/3, 2016 at 1:51 Comment(0)
V
6

App must be installed from Playstore via opt-in URL. this will help the app to authorize from LICENSING & IN-APP BILLING(Base64-encoded).

Edit : We can test the signed apk on device by installing using adb tool. and

1.The android:versionCode and android:versionName attributes values in the AndroidManifest.xml of the application that you are installing matches the values of your APK in the Developer Console.

2.Your application is signed with the same certificate that you used for the APK that you uploaded to the Developer Console, before installing it on your device.

http://developer.android.com/training/in-app-billing/test-iab-app.html

Vanettavang answered 7/3, 2016 at 13:59 Comment(4)
This page states it should be possible to "Install the APK file to your physical test device by using the adb tool."Ashtonashtonunderlyne
I think you should add your email account ...under Click Settings > Account details, then in the License Testing section, add the Google email addresses for your tester accounts.Vanettavang
Solved it, dunno how. See my answer.Ashtonashtonunderlyne
I know this answer is old, but I wanted to correct it a bit anyway. You can sideload the APK onto the device using ADB, you don't have to download it from the store. I frequently publish a build to the store and then make another one locally with matching versionCode. Also the versionName doesn't matter for store testing, only the versionCode does.Jorgenson
A
6

12 hours after my last test this was mysteriously working. The symptoms were:

  • Purchase unavailable if the application was installed to the device via ADB (release & signed)
  • Purchase available as normal if the application was installed via Google Play (download)

What exactly fixed this i'm unsure. Prior to waiting 12 hours I;

  • Switched from using IInAppBillingService directly to using Google's IABHelper. The immediate effect was still product unavailable for purchase, however the text was now displayed in red rather than black (what?) and the DFinsky error changed to subtype 4; PurchaseError{type=3 subtype=4}. I also note that i was not using base64EncodedKey when using IInAppBillingService directly.
  • Switched to multiple APKs (probably red-herring)
  • Started an alpha test (was previously using a beta test only)
  • Created a new gmail account and added it to testers

Even after all these changes, the issue was still occurring, so I went to bed, woke up this morning and with no further changes it just worked. FML.

Ashtonashtonunderlyne answered 10/3, 2016 at 1:51 Comment(0)
B
0

Opt-in url did it for me. Send that to your user - it registers the user with their own play store app. That's the middle man that seems to need to be notified that the person is a tester.

Bulldog answered 28/4, 2017 at 2:41 Comment(1)
How do you do it exactly?Representation
C
0

After almost days of trying everything we accidentally made it work. We had to "LEAVE THE PROGRAM" (link on the opt-in page) and RE-enter the program again. Then it finally worked...

Crescentia answered 21/6, 2017 at 14:27 Comment(0)
J
0

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.

Jp answered 1/11, 2019 at 7:58 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.