Search code examples
androidandroid-billingandroid-inapp-purchaseplay-billing-library

Android Play Billing Library: onSkuDetailsResponse responseCode is 0, but the size of skuDetailsList is also 0


I'm now using the new Play Billing Library

Basically, I followed the documentation to query available items to purchase

 SkuDetailsParams.Builder params = SkuDetailsParams.newBuilder();
            params.setSkusList(skuList).setType(itemType);
            mBillingClient.querySkuDetailsAsync(params.build(),
                    new SkuDetailsResponseListener() {

                        @Override
                        public void onSkuDetailsResponse(int responseCode,
                                                         List<SkuDetails> skuDetailsList) {
                            listener.onSkuDetailsResponse(responseCode, skuDetailsList);
                        }

However, the responseCode is 0 and the list is also empty. But I checked onBillingSetupFinished is successful. The skuList that provided to SkuDetailsParams.Builder is not empty, and the values inside the skuList (sku_id) is also same as Product ID that specifies on Google Play Console.

Does anyone know the reason? Thanks!!


Solution

  • Sounds like you're having issues with your Google Play Console setup.

    Please check that:

    • your app is published in Play Console (to PROD or your @gmail account is in the user's alpha/beta group)
      • I also recommend adding your test @gmail account into license testers list to avoid being charged and license issues
    • has correct signature and version code of test app is equal to published one
    • all of your SKUs are also published
    • your Play Store app works correctly on the phone you're testing (allows you to purchase apps for example)

    And wait for some time after setup is done.