-
Description of your issue
-
My Android users often have the “Unavailable product” error for all my products (consumable and non-consumable) resulting in the “NoProductsAvailable” error. But not in 100% of cases. The bug is reproduced in about 2,000 out of 10,000 users per day.
-
The error is reproducible in users from all countries
-
In 98.5% of cases of this error, the Internet is not available to the user.
-
The error occurs about 1-3 seconds after starting the application
-
On my local Android-device, purchases work successfully. The error doesn’t happen even without internet
-
At the same time, some users make purchases successfully. I have noticed that some users who have successfully made a purchase also encounter this error in previous gaming sessions.
-
This has been happening for a long time, about a year, on different versions of Unity and on different versions of IAP.
-
I am using variables to pass the productId. But the error displays the correct productId, which means that the variables are being read correctly
-
this bug is not reproducible on iOS users. I have about 100 iOS users per day and 0 errors for several month
-
Your purchasing script
-
public void InitializePurchasing() { // If we have already connected to Purchasing ... if (IsInitialized()) { // ... we are done here. return; } if (GetInitStatus() == InitStatus.LOADING) { return; } SetInitStatus(InitStatus.LOADING); // Create a builder, first passing in a suite of Unity provided stores. var builder = ConfigurationBuilder.Instance(StandardPurchasingModule.Instance()); // Add a product to sell / restore by way of its identifier, associating the general identifier // with its store-specific identifiers. foreach (var purchase in purchases) { if (purchase.isConsumable) { builder.AddProduct(purchase.appleId, ProductType.Consumable); } else { builder.AddProduct(purchase.appleId, ProductType.NonConsumable); } }
#if UNITY_ANDROID
// Play Pass
builder.AddProduct(playPassId, ProductType.NonConsumable);
#endif
// Kick off the remainder of the set-up with an asynchrounous call, passing the configuration
// and this class' instance. Expect a response either in OnInitialized or OnInitializeFailed.
UnityPurchasing.Initialize(this, builder);
}
- **Device logs**
- No local device logs, only in production:
109:36:41.717 PM view_list Exception: IAPManager: OnInitializeFailed InitializationFailureReason:NoProductsAvailable
309:36:41.700 PM Unavailable product play_pass_v1-play_pass_v1
409:36:41.700 PM Unavailable product no_ads_v1-no_ads_v1
509:36:41.699 PM Unavailable product expert_kit_v1-expert_kit_v1
609:36:41.698 PM Unavailable product professional_kit_v1-professional_kit_v1
709:36:41.698 PM Unavailable product specialist_kit_v1-specialist_kit_v1
809:36:41.626 PM Unavailable product amateur_kit_v1-amateur_kit_v1
909:36:41.616 PM Unavailable product beginners_kit_v1-beginners_kit_v1
- **Unity Version**
- 2019.4 and 2020.3
- **Unity IAP version**
- IAP 3.1.0 - 4.0.3
- **Platform you are building for:** Android
- **Store you are targeting:** Google Play