Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

NoProductsAvailable exception on some devices

Discussion in 'Unity IAP' started by wenkly, Jun 2, 2021.

  1. wenkly

    wenkly

    Joined:
    Sep 4, 2014
    Posts:
    12
    Hi,

    We are bothering with a problem that on some devices and fresh install of apk IAP is not initialized and exception NoProductsAvailable is occurring.

    IsEmpty() is false, but when initializing there are no products available.



    Do you guys have any idea what can be wrong or where should we test to find a solution? We noticed that on high tier devices everything is ok, but on some medium/low tier IAP can't be initialized.
     
  2. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    Are you able to reproduce?
     
  3. wenkly

    wenkly

    Joined:
    Sep 4, 2014
    Posts:
    12
    Yeah, on some devices our testers can reproduce it.
     
  4. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    OK. Once you share the steps to reproduce, we can continue to troubleshoot.
     
  5. wenkly

    wenkly

    Joined:
    Sep 4, 2014
    Posts:
    12
    It's nothing special.
    1. Install application
    2. Complete tutorial
    3. Go back to Main Menu
    4. Try to display IAP window or buy something (you can't because there is no prices)

    As I was writing, on high/medium tier devices everything is good
     
  6. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    I will need more information, I'm asking how I might reproduce, not yourself. Please show your code. Otherwise please compare to the Sample IAP Project v2 https://forum.unity.com/threads/sample-iap-project.529555/#post-6950270 What devices specifically? Can you confirm it's a memory issue, perhaps the problem devices only have 1Gig RAM for example.
     
  7. masourek

    masourek

    Joined:
    Apr 24, 2020
    Posts:
    3
    Hey Jeff, I'm unrelated to wenkly's report but I'm also sitting on top of hundreds of those errors daily currently in our production release.

    I have gathered so far that it does not seem to correlate with anything except memory - all our NoProductsAvailable reports in bugsnag (those with network on) seem to have approx 0.5gb or less totalMemory. I couldnt find any other correlation.

    Not only that, but we're also seeing a huge number of "Unavailable product <here-name> UnityEngine.Purchasing.Extension.UnityUtil:Update()" for each and every product we have in game.

    I am happy to let you in to our bugsnag to take a look if you're interested to hunt for more details.

    I was not able to reproduce this myself, but I presume a good way to reproduce would be to download our app (Idle Car Factory) and run it on something with less than 0.5gb available.

    More - this seems to have started happening on our app since we changed the unity version to 2020.3.1f from unity 2018.4.x, surprisingly not when we updated the IAP plugin (we updated a long time before switching unity versions).

    Anyway, our current "stack" is Unity 2020.3.11f, In App Purchasing plugin v3.1.0 and we're drowning in those errors.

    Let me know if I can provide anything to help you solve this. I am attaching a few example reports.

    rep_1.PNG rep_2.PNG rep_3.PNG rep_4.PNG
     
  8. wenkly

    wenkly

    Joined:
    Sep 4, 2014
    Posts:
    12
    @JeffDUnity3D
    In our case, the amount of the ram does not matter much, because on a phone with an 8GB ram the products are not loaded properly.

    These bugs fall on some devices where IAPs don't work. Everything is fine on most devices.
    The app is already released and IAPSs are working.
    All we have done is migrate from Unity 2019 to 2020, then when IAPs didn't work on some devices we migrate IAPs to version 3

    IAPs does not work on these devices:
    Redmi Note 9 3/64
    OnePlus T7 HD1903




    There is our products initialization:
     
    Last edited: Jun 7, 2021
  9. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    This may be expected on these devices, and is likely a separate topic. And this is a separate error, NoProductsAvailable and initialization fails every time. This can happen if the user is not logged into Google Play (the Play Store) on the device. ProductUnavailable occurs after initialization succeeds.
     
    Last edited: Jun 7, 2021
  10. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    Yes, it may be memory pressure on RAM restricted devices. Have you done memory profiling during the purchase process to see if there is a spike? I just tested using the Unity Profiler and didn't see any memory spikes during purchase on my Android device.
     
    Last edited: Jun 7, 2021
  11. masourek

    masourek

    Joined:
    Apr 24, 2020
    Posts:
    3
    As far as I know it's not happening during purchase, but rather on the startup of the application. From bugsnag data it appears it's usually literally up to two seconds after startup. Also usually (but not always) there is a spam of "Unavailable product" right before the NoProductsAvailable happens.

    Like here:

    upload_2021-6-7_23-30-53.png


    I'm unable to try and debug this unfortunately as I'm not able to reproduce on any of my devices. All I have to work with now is this bunch of bug reports in bugsnag.

    The amount of those errors we get is rather worryingly high by the way. Our DAU is approx 2.8k and there is around 500 of those errors coming in daily, so it seems to be happening quite often.

    Thanks for your interest in this, and for trying to help. Any ideas on how may we approach this? Perhaps there is a way to make IAP plugin log some debug information that may shed some light? I could turn this on temporarily and release to a subset of users.
     
  12. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    And it works for you as expected when you are not logged into Google Play on the device? NoProductsAvailable during IAP initialization is expected on Android if the user is not logged in. Interesting that you mentioned that it started after a Unity upgrade and not an IAP upgrade. At any rate, we need to reproduce the issue first. We can't make changes without knowing the specific root cause, nor test any potential fix. I have let the engineering team know of this conversation, hopefully we'll spot something.
     
  13. MatL

    MatL

    Joined:
    Jan 29, 2014
    Posts:
    43
    I am having the same issue, I can't reproduce it but I see those errors on unity crashes and exceptions. Tested signing out of google play, and doesn't happen, I can share the errors logs if is helpful.
     
  14. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    Please share further information. What specific errors are you seeing, and which devices is it occurring on?
     
  15. MatL

    MatL

    Joined:
    Jan 29, 2014
    Posts:
    43
    I am sending the error to unity cloud crashes. I am seeing NoProductsAvailable when we initialize the store, on a few users per day don't look to be a connection issue, and it seems to many for having users not logged to the store.
    Most have install_store:com.android.vending and install_mode:store.
    I can share with you the unity exceptions URL by pm now that it seems to be supported.

    upload_2021-12-10_16-41-15.png
     
  16. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    Those devices may not have the Google Play Store installed, one thing to keep in mind. They also may now require their own IAP libraries.
     
  17. MatL

    MatL

    Joined:
    Jan 29, 2014
    Posts:
    43
    Most have "install_store:com.android.vending" and "install_mode:store" that doesn't mean that were installed from google play?
     
  18. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    I meant the device needs to have the Google Play Store app installed. If you get that error, you should tell the user to ensure to be logged into Google Play on the device.