简体   繁体   中英

Android In-app billing purchase - Item not found

I have implemented In-app Billing V3 with this plugin for phonegap. When I purchase my item, google play returns the following

The item that you were attempting to purchase could not be found

This is most probably a setup issue somewhere, but I can't find what could be the problem.

This is what I have done so far:

  • Item created on google play and active with a price
  • Queried Item ID is the same as the one on google play
  • Uploaded my apk in the alpha channel ( also tried beta channel), it is in 'Draft in Alpha' status
  • Waited few hours ( 48h! )
  • Used a different gmail account to test the purchase
  • Test account email address is in the Licence white list
  • Also created a google group and added the test user in it
  • Tested the app on two differents devices
  • APK signed and uploaded google play. Same version is installed on the device
  • Tried With Managed and Unmanaged products
  • Purchased item android.test.purchased works
  • The billing key in the configuration is the same as the one on google play
  • Google Play version on device: 4.8.20

Here is the stack I have from logcat, strange error at the end, not sure if it is related:

    D/CordovaLog(32254): file:///android_asset/www/plugins/com.smartmobilesoftware.inappbilling/www/inappbilling.js: Line 6 : InAppBilling[js]: setup ok
    I/Web Console(32254): InAppBilling[js]: setup ok:6
    D/CORDOVA_BILLING(32254): init start
    D/CORDOVA_BILLING(32254): Creating IAB helper.
    D/CORDOVA_BILLING(32254): Starting setup.
    D/IabHelper(32254): Starting in-app billing setup.
    W/PluginManager(32254): THREAD WARNING: exec() call to InAppBillingPlugin.init blocked the main thread for 21ms. Plugin should use CordovaInterface.getThreadPool().
    D/IabHelper(32254): Billing service connected.
    D/IabHelper(32254): Checking for in-app billing 3 support.
    D/Finsky  (32296): [2476] InAppBillingUtils.getPreferredAccount: com.montreal.deps: Account from first account - [sdkNy9OtgBRMmwDfMof3YGfedjA]
    D/IabHelper(32254): In-app billing version 3 supported for com.montreal.deps
    D/Finsky  (32296): [2451] InAppBillingUtils.getPreferredAccount: com.montreal.deps: Account from first account - [sdkNy9OtgBRMmwDfMof3YGfedjA]
    D/IabHelper(32254): Subscriptions AVAILABLE.
    D/CORDOVA_BILLING(32254): Setup finished.
    D/CORDOVA_BILLING(32254): Setup successful. Querying inventory.
    D/IabHelper(32254): Starting async operation: refresh inventory
    D/IabHelper(32254): Querying owned items, item type: inapp
    D/IabHelper(32254): Package name: com.montreal.deps
    D/IabHelper(32254): Calling getPurchases with continuation token: null
    D/Finsky  (32296): [2450] InAppBillingUtils.getPreferredAccount: com.montreal.deps: Account from first account - [sdkNy9OtgBRMmwDfMof3YGfedjA]
    D/Finsky  (32296): [2450] InAppBillingUtils.getPreferredAccount: com.montreal.deps: Account from first account - [sdkNy9OtgBRMmwDfMof3YGfedjA]
    D/IabHelper(32254): Owned items response: 0
    D/IabHelper(32254): Continuation token: null
    D/IabHelper(32254): Querying SKU details.
    D/IabHelper(32254): queryPrices: nothing to do because there are no SKUs.
    D/IabHelper(32254): Querying owned items, item type: subs
    D/IabHelper(32254): Package name: com.montreal.deps
    D/IabHelper(32254): Calling getPurchases with continuation token: null
    D/Finsky  (32296): [2476] InAppBillingUtils.getPreferredAccount: com.montreal.deps: Account from first account - [sdkNy9OtgBRMmwDfMof3YGfedjA]
    D/Finsky  (32296): [2476] InAppBillingUtils.getPreferredAccount: com.montreal.deps: Account from first account - [sdkNy9OtgBRMmwDfMof3YGfedjA]
    D/IabHelper(32254): Owned items response: 0
    D/IabHelper(32254): Continuation token: null
    D/IabHelper(32254): Querying SKU details.
    D/IabHelper(32254): queryPrices: nothing to do because there are no SKUs.
    D/IabHelper(32254): Ending async operation: refresh inventory
    D/CORDOVA_BILLING(32254): Inside mGotInventoryListener
    D/CORDOVA_BILLING(32254): Query inventory was successful.
    D/CordovaLog(32254): file:///android_asset/www/plugins/com.smartmobilesoftware.inappbilling/www/inappbilling.js: Line 6 : InAppBilling[js]: buy called!
    I/Web Console(32254): InAppBilling[js]: buy called!:6
    D/IabHelper(32254): Starting async operation: launchPurchaseFlow
    D/IabHelper(32254): Constructing buy intent for deps.item.test, item type: inapp
    D/Finsky  (32296): [2451] InAppBillingUtils.getPreferredAccount: com.montreal.deps: Account from first account - [sdkNy9OtgBRMmwDfMof3YGfedjA]
    D/Finsky  (32296): [2451] InAppBillingUtils.getPreferredAccount: com.montreal.deps: Account from first account - [sdkNy9OtgBRMmwDfMof3YGfedjA]
    D/Finsky  (32296): [2451] InAppBillingUtils.getPreferredAccount: com.montreal.deps: Account from first account - [sdkNy9OtgBRMmwDfMof3YGfedjA]
    D/IabHelper(32254): Launching buy intent for deps.item.test. Request code: 10001
    W/PluginManager(32254): THREAD WARNING: exec() call to InAppBillingPlugin.buy blocked the main thread for 28ms. Plugin should use CordovaInterface.getThreadPool().
    D/CordovaActivity(32254): Paused the application!
    D/CordovaWebView(32254): Handle the pause
    D/FirewallPolicy( 2119): getURLFilterEnabled(true)
    D/FirewallPolicy( 2119): isUrlBlocked - Policy disabled
    D/WebView (32254): loadUrlImpl: called
    D/webcore (32254):  CORE loadUrl: called
    D/webkit  (32254): Firewall not null
    D/FirewallPolicy( 2119): getURLFilterEnabled(true)
    D/FirewallPolicy( 2119): isUrlBlocked - Policy disabled
    D/webkit  (32254): euler: isUrlBlocked = false
    D/FirewallPolicy( 2119): getURLFilterEnabled(true)
    D/FirewallPolicy( 2119): isUrlBlocked - Policy disabled
    I/ClipboardServiceEx( 2119): Send intent for dismiss clipboard dialog inside hideCurrentInputLocked() !
    D/WindowManager( 2119): PhoneWindowManager: focusChangedLw
    D/KeyguardViewMediator( 2119): setHidden false
    D/CordovaLog(32254): file:///android_asset/www/app/js/controllers/payment.js: Line 12 : response then payment
    I/Web Console(32254): response then payment:12
    D/CordovaLog(32254): file:///android_asset/www/app/js/controllers/payment.js: Line 13 : OK
    I/Web Console(32254): OK:13
    D/Finsky  (32296): [1] CarrierParamsAction.createCarrierBillingParameters: Carrier billing config is null. Device is not targeted for DCB 2.
    E/Finsky  (32296): [2472] FileBasedKeyValueStore.delete: Attempt to delete 'paramsopT-pzzx02i69KNTNDgLqg' failed!

Many thanks if you find the problem as I have been fighting with it for few days now.

APKs in draft status do no longer work for testing in-app billing. You need to release it in the alpha or beta channel.

Reference: http://developer.android.com/google/play/billing/billing_testing.html#draft_apps

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM