1

Following code doesn't work

                List<String> test = new ArrayList<>();
                test.add("product_1");
                test.add("product_2");
                SkuDetailsParams.Builder params = SkuDetailsParams.newBuilder();
                params.setSkusList(test).setType(BillingClient.SkuType.INAPP);

                billingClient.querySkuDetailsAsync(params.build(),
                        new SkuDetailsResponseListener() {
                            @Override
                            public void onSkuDetailsResponse(BillingResult billingResult,
                                                             List<SkuDetails> skuDetailsList) {
                         
                                    skuDetailsList.size() // size is 0
                                }

                            }
                        });

But if I remove test.add("product_1"); or test.add("product_2") line then it gives the skuDetailsList with size 1 with the expected skuDetails object.

so it doesn't work if I add more than one element to the list, how can I solve this issue?

Thanks!

beginner
  • 2,366
  • 4
  • 29
  • 53

1 Answers1

1

after waiting for some time and reinstalling the app same code starts working, still not sure what went wrong, and what really worked but if anyone faces this issue

  • wait for some time after creating a new SKU product in the google play store console
  • try clearing cache for google play store and make sure you are signed in to your playstore account
beginner
  • 2,366
  • 4
  • 29
  • 53