Skip to content Skip to sidebar Skip to footer

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.newBuild

Solution 1:

I have spent few hours with this issue and the problem was that my debug build/CI builds had applicationIdSuffix. So only production build with proper applicationId was able to retrieve the products.

Solution 2:

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.

Solution 3:

I also had the same problem, but by doing the following, I got SkuDetails.

  • Stop Google Play app
  • Delete cache of Google Play app
  • Stop the application and start it

Solution 4:

The core problem is that Google caches your SKU details, and there are multiple layers of cache.

The local Google Play Store app on your phone caches SKU details, and Google's server-side caches them, too. ("There are only two hard things in Computer Science: cache invalidation and naming things.")

Eventually, if you wait long enough, the caches will expire and Google will start showing the right information. But who has time for that?

Since there's a time element involved, it it's hard to know what helps and what doesn't, but here's what worked for me.

  1. Set up a version of your APK on the Internal Test track. (The first time you do this, you'll have to wait for your app to finish "Pending Publication." The waiting itself may solve the problem.)

    Set up at least one tester, get the opt-in link (this requires waiting for your app to finish "Pending Publication"), and opt-in.

  2. Force stop and delete the cache of the Google Play Store app, using the "Apps" section of the Settings app. Click on "Storage" to access the "Clear Cache" button.

  3. Download a version of the app via the Internal Test track. Use android.util.Log to log your SKU details, and use Logcat to verify that your SKU details are showing correctly.

… but don't worry, you won't have to do this every time you want to test. Once the Google Play Store cache is up to date, you should be able to access your SKUs in debug builds using Android Studio.

If it doesn't work in your Internal Test build

  1. Uninstall the app, force stop the Google Play Store app, clear its cache, and download the Internal Test build again.
  2. Still not working? Something's wrong in your Google Play Developer Console. Perhaps your product is not yet active? Perhaps you misspelled the SKU in your SKU list?

If it works in your Internal Test build but doesn't work in a debug build on the same device

In this case, the Google Play Store cache is correct, but there's something different about your debug build vs. the Internal Test version you created.

  1. Verify that your debug build is using the same package name as the Internal Test build. applicationIdSuffix is a common culprit here.
  2. Verify that your debug build version code matches the APK version code you uploaded to Internal Test.
  3. Try manually installing your Internal Test APK without using the Google Play Store. If that works, you have two APKs, one of which works, and one of which doesn't. Inspect them for differences. (APKs are zip files; you can poke around in there.)

Solution 5:

If the product integrated in the application is a subscription make sure to set SkuType.SUBS and not SkuType.INAPP

valskuDetailsParams= SkuDetailsParams.newBuilder()
    ...
    .setType(SkuType.SUBS)
    .build()

GL

Source

Post a Comment for "Android Play Billing Library: Onskudetailsresponse Responsecode Is 0, But The Size Of Skudetailslist Is Also 0"