Purchasing failed to initialize. Reason: NoProductsAvailable

I have a app which IAP is fine when using IAP 2.x
However after upgrade to 3.0.1 and also tried 3.0.2 and 3.1, Apple Store is fine but Google Play does not work anymore.
There is no change on IAP item or category.

Please advise where should I looking for. I can fall back to v2 but Google is going to ban v2 IAP in 6 month so it does not make much sense.

================ Unity Version
04-22 07:23:42.771 17256 17298 I Unity : MemoryManager: Using ‘Dynamic Heap’ Allocator.
04-22 07:23:42.792 17256 17298 I Unity : SystemInfo CPU = ARM64, Cores = 8, Memory = 5629mb
04-22 07:23:42.792 17256 17298 I Unity : SystemInfo ARM big.LITTLE configuration: 4 big (mask: 0xf0), 4 little (mask: 0xf)
04-22 07:23:42.792 17256 17298 I Unity : ApplicationInfo com.xxxx version 2.3.1943 build 6042f612-f6ef-4d18-9cb8-d33878fd1b7c
04-22 07:23:42.792 17256 17298 I Unity : Built from ‘2019.4/staging’ branch, Version ‘2019.4.24f1 (5da6f0345e82)’, Build type ‘Release’, Scripting Backend ‘il2cpp’, CPU ‘arm64-v8a’, Stripping ‘Disabled’
04-22 07:23:43.142 1617 3399 I Timeline: Timeline: Activity_windows_visible id: ActivityRecord{3f84780 u0 com.XCMania/com.unity3d.player.UnityPlayerActivity t755} time:2426253
04-22 07:23:45.146 2365 2365 D MiWallpaper-MarsSuperWallpaper: MSG_UNITY_PAUSE
04-22 07:
================ IAP Version
04-22 07:23:45.351 17256 17298 I Unity : Initializing UnityPurchasing via Codeless IAP
04-22 07:23:45.351 17256 17298 I Unity : UnityEngine.Purchasing.CodelessIAPStoreListener:CreateCodelessIAPStoreListenerInstance()
04-22 07:23:45.351 17256 17298 I Unity : UnityEngine.Purchasing.CodelessIAPStoreListener:get_Instance()
04-22 07:23:45.351 17256 17298 I Unity : UnityEngine.Purchasing.IAPListener:OnEnable()
04-22 07:23:45.351 17256 17298 I Unity :
04-22 07:23:45.351 17256 17298 I Unity : (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 39)
04-22 07:23:45.351 17256 17298 I Unity :
04-22 07:23:45.371 17256 17298 I Unity : UnityIAP Version: 3.0.1
04-22 07:23:45.371 17256 17298 I Unity : UnityEngine.Purchasing.StandardPurchasingModule:Instance(AppStore)
04-22 07:23:45.371 17256 17298 I Unity : UnityEngine.Purchasing.CodelessIAPStoreListener:InitializePurchasing()
04-22 07:23:45.371 17256 17298 I Unity : UnityEngine.Purchasing.CodelessIAPStoreListener:get_Instance()
04-22 07:23:45.371 17256 17298 I Unity : UnityEngine.Purchasing.IAPListener:OnEnable()
04-22 07:23:45.371 17256 17298 I Unity :
04-22 07:23:45.371 17256 17298 I Unity : (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 39)
0
================ Error

04-21 05:09:08.438 10894 10957 E Unity : Purchasing failed to initialize. Reason: NoProductsAvailable
04-21 05:09:08.438 10894 10957 E Unity : UnityEngine.Purchasing.CodelessIAPStoreListener:OnInitializeFailed(InitializationFailureReason)
04-21 05:09:08.438 10894 10957 E Unity : System.Action:Invoke()
04-21 05:09:08.438 10894 10957 E Unity : UnityEngine.Purchasing.Extension.UnityUtil:Update()

@CopycatX5 is the user logged into Google Play on the device ? We now return NoProductsAvailable if not, we plan to improve that.

Hi,

Is there an api to tell if user has logged in to Google Play?

No there is not. What issue are you seeing? Are you able to reproduce? We are planning to add a callback during our initialization retry that you could check, this should be available in an upcoming release.

I’m trying to build for Amazon Firestick and i keep getting this error. I even tried

        Debug.Log(controller.products.all.Length);

In the OnInitialized callback, it’s printing off 2, but then when i get into the scene(after it’s already printed the 2 products) i’m getting an error for “no products available”. How could it be initialized with 2 products, yet right after say there’s no products available?

Edit: I’m on 2020.3.17 if that makes a difference, my client seems to think this is the best version for Firestick so i can’t upgrade to a newer version lol

Hello,

The controller holds the products you added via IAP, but those products have to be available (Product.availableToPurchase must be true).

In your logs, you should have 2 entries with “Unavailable product {product id}-{store specific product id}” indicating that both are unavailable.

availableToPurchase is set to true when the product is retrieved from the store.
In your logs, after “onPurchaseUpdatesResponse”, you could see if any products have failed to be retrieved and the reason why.
Make sure that your product ids matches the one you setup in your store.

1 Like

Thanks for your reply.

Hmm, I think i solved that issue, but it’s strange, now it says “Purchasing failed to initialize, reason: Purchasing unavailable.” I looked this up and heard it was an issue that showed up with the newer version of the IAP package, so i downgraded, but now it never initializes at all, logcat’s showing me the initialize method was called but the OnInitialize callback is never called…

The “PurchasingUnavailable” can happen on all versions of IAP, but there should be information in your logs giving you more information on why it failed to initialize.

If you provide your logs, I could take a look at them to try to identify what the problem is.