GooglePlay:您请求的商品无法购买 [英] GooglePlay: The item you requested is not available for purchase

查看:3314
本文介绍了GooglePlay:您请求的商品无法购买的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从Google Play IAB API获取以下内容:


您购买的商品无法购买


然而,我已经成功测试了静态响应,此外,以下代码返回 myProductId 在可用产品列表中;

  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);

另外我有;


  • 发布测试版APK

  • 在测试版中添加测试用户并通过网址选择

  • 用设备登录测试用户(gmail帐户)

  • 将具有相同版本代码的已签名APK推送到设备
  • 激活产品



我使用的是我的购买代码;

 捆绑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));

最后,logcat显示以下内容;

  D / Finsky:[1] PurchaseFragment.onStateChange:Error:PurchaseError {type = 3 subtype = 0} 
D / Finsky:[1] PurchaseFragment.onStateChange:购买失败:PurchaseError {type = 3 subtype = 0}

虽然还有其他问题与这个问题有关,他们都没有为我解决;


  1. 您请求的商品无法购买


    • 产品处于活动状态


  2. 您已请求的项目不可购买


    • 用产品 android.test.purchased <静态响应成功/ li>




    • 测试用户登录


在我最后一次测试后的12小时,这是神秘的工作。症状是:



完全解决这个问题不确定。在等待12个小时之前,我;


  • 直接使用 IInAppBillingService IABHelper 。立即产生的效果仍然是产品无法购买,但文本现在显示为红色而不是黑色(什么?),DFinsky错误更改为子类型4; PurchaseError {type = 3 subtype = 4} 。我还注意到,当直接使用 IInAppBillingService 时,我并没有使用base64EncodedKey。

  • 切换到多个APK(可能是红鲱鱼) li>
  • 开始一个alpha测试(以前只使用测试版测试)

  • 创建一个新的gmail帐户并将其添加到测试人员中



即使在所有这些变化之后,问题仍然在发生,所以我上床睡觉,今天早上醒来,没有进一步的改变。 FML。

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

解决方案

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.

这篇关于GooglePlay:您请求的商品无法购买的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆