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

Unity: Purchasing failed to initialize. Reason: NoProductsAvailable??

Discussion in 'Unity IAP' started by HeathC, Nov 30, 2020.

Thread Status:
Not open for further replies.
  1. HeathC

    HeathC

    Joined:
    Oct 17, 2016
    Posts:
    110
    so I have my game rolled out in alpha testing, approved, a separate google account as my tester, who is also added as a license tester, and even with the build off the google play store that now shows up, AND, all my IAPs show active, yet I keep getting this "Unity: Purchasing failed to initialize. Reason: NoProductsAvailable" after it goes through all of them and checks them... I can't get my iaps to work... anyone else have this issue on android? Am I missing a step?
     
  2. HeathC

    HeathC

    Joined:
    Oct 17, 2016
    Posts:
    110
    it goes through each approved IAP with the correct ids and returns each one unavailable, but they are all active, all approved in alpha, all being access by a license tester
     
  3. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    Please share the device logs which will confirm the spelling of your ProductIDs as defined in your game, compared to the ProductIDs as defined on your Google Play developer dashboard, and share a screenshot. Did your user accept the testing invite (on the device) and browse to the Google Play app as directed to download your game? https://forum.unity.com/threads/how-to-capturing-device-logs-on-android.528680/
     
  4. HeathC

    HeathC

    Joined:
    Oct 17, 2016
    Posts:
    110
    Screen Shot 2020-11-30 at 3.22.39 PM.png

    2020-11-29 22:53:06.012 4364-7563/? I/Unity: Initializing UnityPurchasing via Codeless IAP

    UnityEngine.Logger:Log(LogType, Object)

    UnityEngine.Purchasing.CodelessIAPStoreListener:CreateCodelessIAPStoreListenerInstance()



    (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

    2020-11-29 22:53:06.030 4364-7563/? I/Unity: UnityIAP Version: 2.2.2

    UnityEngine.Logger:Log(Object)

    UnityEngine.Purchasing.StandardPurchasingModule:Instance(AppStore)

    UnityEngine.Purchasing.CodelessIAPStoreListener:InitializePurchasing()



    (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

    2020-11-29 22:53:06.414 4047-5969/? V/WindowManager: Relayout Window{5f9a8a9 u0 com.mrheathclose.idlearcadetycoon/com.unity3d.player.UnityPlayerActivity}: viewVisibility=0 req=1200x1920

    2020-11-29 22:53:06.424 4364-4364/? D/ViewRootImpl@4cdab33[UnityPlayerActivity]: Relayout returned: old=(0,0,1200,1920) new=(0,0,1200,1920) req=(1200,1920)0 dur=11 res=0x1 s={true 3202084864} ch=false

    2020-11-29 22:53:06.658 4364-7563/? W/Unity: Unavailable product 500Tokens.IdleArcadeTycoon -500.tokens_idle.arcade.tycoon

    UnityEngine.Logger:LogFormat(LogType, String, Object[])

    UnityEngine.Purchasing.PurchasingManager:CheckForInitialization()

    UnityEngine.Purchasing.PurchasingManager:OnProductsRetrieved(List`1)

    System.Action:Invoke()

    UnityEngine.Purchasing.Extension.UnityUtil:Update()



    (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

    2020-11-29 22:53:06.658 4364-7563/? W/Unity: Unavailable product 2000Tokens.IdleArcadeTycoon -2000.tokens_idle.arcade.tycoon

    UnityEngine.Logger:LogFormat(LogType, String, Object[])

    UnityEngine.Purchasing.PurchasingManager:CheckForInitialization()

    UnityEngine.Purchasing.PurchasingManager:OnProductsRetrieved(List`1)

    System.Action:Invoke()

    UnityEngine.Purchasing.Extension.UnityUtil:Update()



    (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

    2020-11-29 22:53:06.658 4364-7563/? W/Unity: Unavailable product 5000Tokens.IdleArcadeTycoon -5000.tokens_idle.arcade.tycoon

    UnityEngine.Logger:LogFormat(LogType, String, Object[])

    UnityEngine.Purchasing.PurchasingManager:CheckForInitialization()

    UnityEngine.Purchasing.PurchasingManager:OnProductsRetrieved(List`1)

    System.Action:Invoke()

    UnityEngine.Purchasing.Extension.UnityUtil:Update()



    (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

    2020-11-29 22:53:06.659 4364-7563/? W/Unity: Unavailable product PermaboostMachine.IdleArcadeTycoon -permaboost.machine_idle.arcade.tycoon

    UnityEngine.Logger:LogFormat(LogType, String, Object[])

    UnityEngine.Purchasing.PurchasingManager:CheckForInitialization()

    UnityEngine.Purchasing.PurchasingManager:OnProductsRetrieved(List`1)

    System.Action:Invoke()

    UnityEngine.Purchasing.Extension.UnityUtil:Update()



    (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

    2020-11-29 22:53:06.661 4364-7563/? W/Unity: Unavailable product PermaboostManager.IdleArcadeTycoon -permaboost.manager_idle.arcade.tycoon

    UnityEngine.Logger:LogFormat(LogType, String, Object[])

    UnityEngine.Purchasing.PurchasingManager:CheckForInitialization()

    UnityEngine.Purchasing.PurchasingManager:OnProductsRetrieved(List`1)

    System.Action:Invoke()

    UnityEngine.Purchasing.Extension.UnityUtil:Update()



    (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

    2020-11-29 22:53:06.662 4364-7563/? W/Unity: Unavailable product PermaboostCar.IdleArcadeTycoon -permaboost.car_idle.arcade.tycoon

    UnityEngine.Logger:LogFormat(LogType, String, Object[])

    UnityEngine.Purchasing.PurchasingManager:CheckForInitialization()

    UnityEngine.Purchasing.PurchasingManager:OnProductsRetrieved(List`1)

    System.Action:Invoke()

    UnityEngine.Purchasing.Extension.UnityUtil:Update()



    (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

    2020-11-29 22:53:06.662 4047-6027/? V/WindowManager: Relayout Window{5f9a8a9 u0 com.mrheathclose.idlearcadetycoon/com.unity3d.player.UnityPlayerActivity}: viewVisibility=0 req=1200x1920

    2020-11-29 22:53:06.662 4364-7563/? W/Unity: Unavailable product PrestigeBoost.IdleArcadeTycoon -prestige.boost_idle.arcade.tycoon

    UnityEngine.Logger:LogFormat(LogType, String, Object[])

    UnityEngine.Purchasing.PurchasingManager:CheckForInitialization()

    UnityEngine.Purchasing.PurchasingManager:OnProductsRetrieved(List`1)

    System.Action:Invoke()

    UnityEngine.Purchasing.Extension.UnityUtil:Update()



    (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

    2020-11-29 22:53:06.662 4364-7563/? W/Unity: Unavailable product SkipAdsForever103build2.IdleArcadeTycoon -skip.ads.forever_idle.arcade.tycoon

    UnityEngine.Logger:LogFormat(LogType, String, Object[])

    UnityEngine.Purchasing.PurchasingManager:CheckForInitialization()

    UnityEngine.Purchasing.PurchasingManager:OnProductsRetrieved(List`1)

    System.Action:Invoke()

    UnityEngine.Purchasing.Extension.UnityUtil:Update()



    (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

    2020-11-29 22:53:06.663 4364-7563/? W/Unity: Unavailable product 10000Tickets.IdleArcadeTycoon -10000.tickets_idle.arcade.tycoon

    UnityEngine.Logger:LogFormat(LogType, String, Object[])

    UnityEngine.Purchasing.PurchasingManager:CheckForInitialization()

    UnityEngine.Purchasing.PurchasingManager:OnProductsRetrieved(List`1)

    System.Action:Invoke()

    UnityEngine.Purchasing.Extension.UnityUtil:Update()



    (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

    2020-11-29 22:53:06.664 4364-7563/? E/Unity: Purchasing failed to initialize. Reason: NoProductsAvailable

    UnityEngine.Logger:Log(LogType, Object)

    UnityEngine.Purchasing.CodelessIAPStoreListener:OnInitializeFailed(InitializationFailureReason)

    UnityEngine.Purchasing.PurchasingManager:CheckForInitialization()

    UnityEngine.Purchasing.PurchasingManager:OnProductsRetrieved(List`1)

    System.Action:Invoke()

    UnityEngine.Purchasing.Extension.UnityUtil:Update()

    yes, the user is a tester, as well as a license tester, and the game was downloaded from store, and is the version in the alpha track, so it was reviewed, approved, and published to the track, and as you can see above, all IAPs are active.
     

    Attached Files:

  5. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    Your product definitions in your code do not match the exact spellings on your Dashboard and use - instead of _
     
  6. HeathC

    HeathC

    Joined:
    Oct 17, 2016
    Posts:
    110
    are you saying that the identical google play id overrides from unity iap that are listed after the dashes in the errors don't match the screenshot? They are copy and paste identical. Am I misunderstanding?
     
  7. HeathC

    HeathC

    Joined:
    Oct 17, 2016
    Posts:
    110
    that would cause a product to be unavailable? it's an allowed character in the iap naming
     
  8. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    Please post a screenshot of your product definitions in your IAP Catalog in the Unity Editor to confirm the spelling.
     
  9. HeathC

    HeathC

    Joined:
    Oct 17, 2016
    Posts:
    110
    Screen Shot 2020-11-30 at 4.33.27 PM.png Screen Shot 2020-11-30 at 4.33.15 PM.png Screen Shot 2020-11-30 at 4.32.56 PM.png Screen Shot 2020-11-30 at 4.32.40 PM.png Screen Shot 2020-11-30 at 4.32.24 PM.png
     
  10. HeathC

    HeathC

    Joined:
    Oct 17, 2016
    Posts:
    110
    Screen Shot 2020-11-30 at 4.27.38 PM.png Screen Shot 2020-11-30 at 4.27.23 PM.png Screen Shot 2020-11-30 at 4.27.02 PM.png Screen Shot 2020-11-30 at 4.26.25 PM.png
     
  11. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    Got it. For testing, what if you didn't use the store overrides and used the Google productID directly?
     
  12. HeathC

    HeathC

    Joined:
    Oct 17, 2016
    Posts:
    110
    I will try that, get it uploaded, reviewed, approved, and installed... I'll get back to you when that process is complete.
     
  13. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    Probably no need to go through that whole process, just directly side-load the app via USB and test directly if you've already done that step once.
     
  14. HeathC

    HeathC

    Joined:
    Oct 17, 2016
    Posts:
    110
    I was under the impression that you can't test IAPs unless it comes from the play store version that has the approved app in that track. That's something I came across in my research trying to make this work.
     
    Last edited: Dec 1, 2020
  15. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    That is correct. The first time you test, you need to go through the whole process. But after that, you can side-load to test updates directly, I do it every day in my testing, including today.
     
  16. HeathC

    HeathC

    Joined:
    Oct 17, 2016
    Posts:
    110
    unless I misunderstand, there hasn't been a first time for me yet, it still doesn't work... about to test it now, though, as the build has been approved
     
  17. HeathC

    HeathC

    Joined:
    Oct 17, 2016
    Posts:
    110
    hmmm even after 12 hours the latest version isn't the one on the store, will try to side load and see.
     
  18. HeathC

    HeathC

    Joined:
    Oct 17, 2016
    Posts:
    110
    This works. I swapped out the apple product into the override and put the google override as the main id, switched it in my purchase code, and it works. (in the side load, that version isn't live in the track after over 12 hours after being approved now, but I'm sure it will work as well... why would it take that long to be live for testers?)

    1. Thank you so much for your help.
    2. That's a bug, right?
     
  19. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    Yes, it does sound like a bug, but we would need to test and confirm here. Also, we don't have any control over the Google review process, I'm glad it's working for you now.
     
  20. HeathC

    HeathC

    Joined:
    Oct 17, 2016
    Posts:
    110
    of course not, I was just asking because it sounded like you had experience with google and I don't.
     
  21. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    Got it, Generally I am able to publish within minutes, but I've heard of delays recently
     
  22. HeathC

    HeathC

    Joined:
    Oct 17, 2016
    Posts:
    110
    well the publish was approved and happened, but it wasn't the version on the store for testers when I checked it 12 hours later
     
  23. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    I've heard that you may also need to update all your Google testing channels with the updated binary.
     
  24. hippogames

    hippogames

    Joined:
    Feb 5, 2015
    Posts:
    228
    Hi! I'm receiving the same error after migrating to IAP 3. The error can be reproduced only after fresh install on a device with no Internet access. If I enable WiFi, the error will never appear again.

    Purchasing failed to initialize. Reason: NoProductsAvailable at UnityEngine.Purchasing.Extension.UnityUtil:Update()
     
    FamishedMammal likes this.
  25. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    This is expected. If there is no Internet, then no products will be available.
     
  26. hippogames

    hippogames

    Joined:
    Feb 5, 2015
    Posts:
    228
    Thanks for the information, but I hope it may be much better to handle this situation in some Initialize() callback.
    Also there is another related issue. If you'll try to make a purchase after IAP wasn't initialized, you'll get another exception, but not OnPurchaseFailed from IAP button as expected. Is it OK?
     
  27. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    Yes, you use the IntializedFailed callback. You need to initialize successfully before attempting to purchase.
     
  28. hippogames

    hippogames

    Joined:
    Feb 5, 2015
    Posts:
    228
    How can I get IntializedFailed callback if I use Codeless IAP?
     
    ZO5KmUG6R likes this.
  29. hippogames

    hippogames

    Joined:
    Feb 5, 2015
    Posts:
    228
    Maybe it's possible to extend IAPListener in future updates?
     
  30. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    You are welcome to modify the listener yourself, if you want.
     
  31. hippogames

    hippogames

    Joined:
    Feb 5, 2015
    Posts:
    228
    Thanks for you answers, but I mean can YOU add the ability to check IAP initialization status in Codeless IAP? As 'Codeless' means (for me) that I want to use out-of-the box solution and don't want to write code. Currently with Codeless IAP I can only get 2 events: ProcessPurchase and OnPurchaseFailed. It would be very cool to add OnInitialized and OnInitializeFailed to IAPListener.cs that is distributed with Codeless. The only possible workaround for me is implementing my own IStoreListener, although it's not very difficult.
     
  32. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    But you already are writing code! You've modified the Codeless code, you don't want to do that. You don't need "another" listener, just use Scripted IAP. Please don't mulitpost, I will go ahead and lock this thread.
     
Thread Status:
Not open for further replies.