如何在getBuyIntent上解决PurchaseError {type = 3 subtype = 0}

时间:2016-02-23 21:19:18

标签: android google-play-services in-app-billing

ServiceConnection工作正常,我可以正确地进行getPurchases,但我无法购买产品。这段代码是片段

PendingIntent pendingIntent = iabService.getBuyIntent(3, getActivity().getPackageName(), sku, "inapp", null).getParcelable("BUY_INTENT");
getActivity().startIntentSenderForResult(pendingIntent.getIntentSender(), 42, new Intent(), 0, 0, 0);

我收到弹出窗口“您请求的项目无法购买”,这是日志。我提问,因为没有任何type = 3 subtype = 0。

D/Finsky: [12320] InAppBillingUtils.getPreferredAccount: it.localhost.itracking: Account determined from installer data - [zgXmi3sMHad8nr8tOaCFW_uVDgo]

I/ActivityManager: START u0 {cmp=com.android.vending/com.google.android.finsky.billing.lightpurchase.IabV3Activity (has extras)} from uid 10024 on display 0

V/GLSActivity: AuthDelegateWrapperCreated with selected intent: Intent { cmp=com.google.android.gms/.auth.DefaultAuthDelegateService }
V/GLSActivity: AuthDelegateWrapperCreated with selected intent: Intent { cmp=com.google.android.gms/.auth.DefaultAuthDelegateService }
V/GLSActivity: AuthDelegateWrapperCreated with selected intent: Intent { cmp=com.google.android.gms/.auth.DefaultAuthDelegateService }

I/ActivityManager: Displayed com.android.vending/com.google.android.finsky.billing.lightpurchase.IabV3Activity: +350ms

I/WCNSS_FILTER: ibs_msm_serial_clock_vote: vote UART CLK OFF using UART driver's ioctl()
I/qtaguid: Failed write_ctrl(u 19) res=-1 errno=22
I/qtaguid: Untagging socket 19 failed errno=-22
W/NetworkManagementSocketTagger: untagSocket(19) failed with errno -22
D/Finsky: [1] PurchaseFragment.onStateChange: Error: PurchaseError{type=3 subtype=0}
D/Finsky: [1] PurchaseFragment.onStateChange: Purchase failed: PurchaseError{type=3 subtype=0}

另一个信息是应用程序诞生于eclipse并工作,当我将项目移动到android工作室时,我收到此错误。

2 个答案:

答案 0 :(得分:1)

此错误表示您未在应用内结算控制台中将此版本设置为生产版或测试版或Alpha版。你有没有把你的版本放在其中一个?

也许你可以看看这个。

https://developer.android.com/google/play/billing/billing_testing.html

答案 1 :(得分:0)

问题独自解决

我在测试版中发布应用程序并收到此错误:我可以上传并将其作为草稿但我无法在测试版中发布

一段时间后,我将能够发布测试版和inapp作品

我不知道为什么