Search Unity

Unavailable product in Unity In app Purchase but it's in my store

Discussion in 'Unity IAP' started by yohanscritch, Mar 7, 2021.

  1. yohanscritch

    yohanscritch

    Joined:
    Apr 30, 2020
    Posts:
    28
    Hi there,

    I am implementing In app purchase and get the following log message when running on Android:


    Code (CSharp):
    1. 03-07 20:50:31.318 25813 26688 W Unity   : Unavailable product com.mygame.noads-com.mygame.noads
    2. 03-07 20:50:31.318 25813 26688 W Unity   : UnityEngine.Purchasing.PurchasingManager:HasAvailableProductsToPurchase(Boolean)
    3. 03-07 20:50:31.318 25813 26688 W Unity   : UnityEngine.Purchasing.PurchasingManager:CheckForInitialization()
    4. 03-07 20:50:31.318 25813 26688 W Unity   : UnityEngine.Purchasing.PurchasingManager:OnProductsRetrieved(List`1)
    5. 03-07 20:50:31.318 25813 26688 W Unity   : System.Action:Invoke()
    6. 03-07 20:50:31.318 25813 26688 W Unity   : UnityEngine.Purchasing.Extension.UnityUtil:Update()
    7.  
    And this is how looks my products on Google Console:

    Capture d’écran 2021-03-07 à 21.01.55.png

    I get this log error when running my APK on a "internal test" on my Google Store account, using a tester account (not a developer one).

    I'm totally lost, can you help me there?
     
  2. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
  3. yohanscritch

    yohanscritch

    Joined:
    Apr 30, 2020
    Posts:
    28
    Hi Jeff, I did everything following the guide, yes. The only difference I sense is that I've run a "Internal test" instead of an "Closed testing", meaning I did not have a validatin from GOogle Play, though the APK was delivered through the store.

    I just tried to do a "Closed testing" (alpha) with validation and I'll test again after the 24hours validation and get back here to tell if that was the reason.
     
    JeffDUnity3D likes this.
  4. yohanscritch

    yohanscritch

    Joined:
    Apr 30, 2020
    Posts:
    28
    Well I'm back after 4 days of Play store validation of my app on the store for alpha testing aaaaand.... It does not work.

    I still have console errors saying that my product are not available. Here are my settings:

    On Google play store :

    upload_2021-3-17_11-45-36.png

    In my code :

    Code (CSharp):
    1. using System;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4. using UnityEngine.Purchasing;
    5.  
    6. // Deriving the Purchaser class from IStoreListener enables it to receive messages from Unity Purchasing.
    7. public class Purchaser : MonoBehaviour, IStoreListener
    8. {
    9.     private static IStoreController m_StoreController;          // The Unity Purchasing system.
    10.     private static IExtensionProvider m_StoreExtensionProvider; // The store-specific Purchasing subsystems.
    11.  
    12.     // Product identifiers for all products capable of being purchased:
    13.     // "convenience" general identifiers for use with Purchasing, and their store-specific identifier
    14.     // counterparts for use with and outside of Unity Purchasing. Define store-specific identifiers
    15.     // also on each platform's publisher dashboard (iTunes Connect, Google Play Developer Console, etc.)
    16.  
    17.  
    18.     public ProductStore PS;
    19.  
    20.  
    21.     void Start()
    22.     {
    23.         // If we haven't set up the Unity Purchasing reference
    24.         if (m_StoreController == null)
    25.         {
    26.             // Begin to configure our connection to Purchasing
    27.             InitializePurchasing();
    28.         }
    29.     }
    30.  
    31.     public void InitializePurchasing()
    32.     {
    33.         // If we have already connected to Purchasing ...
    34.         if (IsInitialized())
    35.         {
    36.             // ... we are done here.
    37.  
    38.             return;
    39.         }
    40.  
    41.         // Create a builder, first passing in a suite of Unity provided stores.
    42.         var builder = ConfigurationBuilder.Instance(StandardPurchasingModule.Instance());
    43.  
    44.         // Products initialization
    45.  
    46.         builder.AddProduct(noAdsID, ProductType.NonConsumable);
    47.  
    48.         builder.AddProduct(threeclueID, ProductType.Consumable);
    49.         builder.AddProduct(tenclueID, ProductType.Consumable);
    50.         builder.AddProduct(lifeID, ProductType.Consumable);
    51.  
    52.  
    53.         // Kick off the remainder of the set-up with an asynchrounous call, passing the configuration
    54.         // and this class' instance. Expect a response either in OnInitialized or OnInitializeFailed.
    55.         UnityPurchasing.Initialize(this, builder);
    56.     }
    57.  
    58.  
    59.     private bool IsInitialized()
    60.     {
    61.         // Only say we are initialized if both the Purchasing references are set.
    62.         return m_StoreController != null && m_StoreExtensionProvider != null;
    63.     }
    64.  
    65.  
    66.     public void BuyThreeClue()
    67.     {
    68.         BuyProductID(threeclueID);
    69.     }
    70.  
    71.     public void BuyTenClue()
    72.     {
    73.         BuyProductID(tenclueID);
    74.     }
    75.  
    76.     public void BuyOneLife()
    77.     {
    78.         BuyProductID(lifeID);
    79.     }
    80.  
    81.     public void BuyNoAds()
    82.     {
    83.         BuyProductID(noAdsID);
    84.     }
    85.  
    86.     void BuyProductID(string productId)
    87.     {
    88.         // If Purchasing has been initialized ...
    89.         if (IsInitialized())
    90.         {
    91.             // ... look up the Product reference with the general product identifier and the Purchasing
    92.             // system's products collection.
    93.             Product product = m_StoreController.products.WithID(productId);
    94.  
    95.             // If the look up found a product for this device's store and that product is ready to be sold ...
    96.             if (product != null && product.availableToPurchase)
    97.             {
    98.                 Debug.Log(string.Format("Purchasing product asychronously: '{0}'", product.definition.id));
    99.                 // ... buy the product. Expect a response either through ProcessPurchase or OnPurchaseFailed
    100.                 // asynchronously.
    101.                 m_StoreController.InitiatePurchase(product);
    102.             }
    103.             // Otherwise ...
    104.             else
    105.             {
    106.                 // ... report the product look-up failure situation
    107.                 Debug.Log("BuyProductID: FAIL. Not purchasing product, either is not found or is not available for purchase");
    108.             }
    109.         }
    110.         // Otherwise ...
    111.         else
    112.         {
    113.             // ... report the fact Purchasing has not succeeded initializing yet. Consider waiting longer or
    114.             // retrying initiailization.
    115.             Debug.Log("BuyProductID FAIL. Not initialized.");
    116.         }
    117.     }
    118.  
    119.  
    120.     // Restore purchases previously made by this customer. Some platforms automatically restore purchases, like Google.
    121.     // Apple currently requires explicit purchase restoration for IAP, conditionally displaying a password prompt.
    122.     public void RestorePurchases()
    123.     {
    124.         // If Purchasing has not yet been set up ...
    125.         if (!IsInitialized())
    126.         {
    127.             // ... report the situation and stop restoring. Consider either waiting longer, or retrying initialization.
    128.             Debug.Log("RestorePurchases FAIL. Not initialized.");
    129.             return;
    130.         }
    131.  
    132.         // If we are running on an Apple device ...
    133.         if (Application.platform == RuntimePlatform.IPhonePlayer ||
    134.             Application.platform == RuntimePlatform.OSXPlayer)
    135.         {
    136.             // ... begin restoring purchases
    137.             Debug.Log("RestorePurchases started ...");
    138.  
    139.             // Fetch the Apple store-specific subsystem.
    140.             var apple = m_StoreExtensionProvider.GetExtension<IAppleExtensions>();
    141.             // Begin the asynchronous process of restoring purchases. Expect a confirmation response in
    142.             // the Action<bool> below, and ProcessPurchase if there are previously purchased products to restore.
    143.             apple.RestoreTransactions((result) => {
    144.                 // The first phase of restoration. If no more responses are received on ProcessPurchase then
    145.                 // no purchases are available to be restored.
    146.                 Debug.Log("RestorePurchases continuing: " + result + ". If no further messages, no purchases available to restore.");
    147.             });
    148.         }
    149.         // Otherwise ...
    150.         else
    151.         {
    152.             // We are not running on an Apple device. No work is necessary to restore purchases.
    153.             Debug.Log("RestorePurchases FAIL. Not supported on this platform. Current = " + Application.platform);
    154.         }
    155.     }
    156.  
    157.  
    158.     //
    159.     // --- IStoreListener
    160.     //
    161.  
    162.     public void OnInitialized(IStoreController controller, IExtensionProvider extensions)
    163.     {
    164.         // Purchasing has succeeded initializing. Collect our Purchasing references.
    165.         Debug.Log("OnInitialized: PASS");
    166.  
    167.         // Overall Purchasing system, configured with products for this application.
    168.         m_StoreController = controller;
    169.         // Store specific subsystem, for accessing device-specific store features.
    170.         m_StoreExtensionProvider = extensions;
    171.     }
    172.  
    173.  
    174.     public void OnInitializeFailed(InitializationFailureReason error)
    175.     {
    176.         // Purchasing set-up has not succeeded. Check error for reason. Consider sharing this reason with the user.
    177.         Debug.Log("OnInitializeFailed InitializationFailureReason:" + error);
    178.     }
    179.  
    180.  
    181.     public PurchaseProcessingResult ProcessPurchase(PurchaseEventArgs args)
    182.     {
    183.  
    184.         if (String.Equals(args.purchasedProduct.definition.id, threeclueID, StringComparison.Ordinal))
    185.         {
    186.             PS.AddClue(3);
    187.         }
    188.  
    189.         if (String.Equals(args.purchasedProduct.definition.id, tenclueID, StringComparison.Ordinal))
    190.         {
    191.             PS.AddClue(10);
    192.         }
    193.  
    194.         if (String.Equals(args.purchasedProduct.definition.id, lifeID, StringComparison.Ordinal))
    195.         {
    196.             PS.AddLife(1);
    197.         }
    198.         if (String.Equals(args.purchasedProduct.definition.id, noAdsID, StringComparison.Ordinal))
    199.         {
    200.             PS.AddNoAds();
    201.         }
    202.  
    203.         // Return a flag indicating whether this product has completely been received, or if the application needs
    204.         // to be reminded of this purchase at next app launch. Use PurchaseProcessingResult.Pending when still
    205.         // saving purchased products to the cloud, and when that save is delayed.
    206.         return PurchaseProcessingResult.Complete;
    207.     }
    208.  
    209.  
    210.     public void OnPurchaseFailed(Product product, PurchaseFailureReason failureReason)
    211.     {
    212.         // A product purchase attempt did not succeed. Check failureReason for more detail. Consider sharing
    213.         // this reason with the user to guide their troubleshooting actions.
    214.         Debug.Log(string.Format("OnPurchaseFailed: FAIL. Product: '{0}', PurchaseFailureReason: {1}", product.definition.storeSpecificId, failureReason));
    215.     }
    216. }
    217.  

    When running in editor:

    upload_2021-3-17_11-46-21.png

    And console when running from device with tester account:

    Code (CSharp):
    1. 03-17 11:30:00.009 16316 17550 I Unity   : MenuController:Start()
    2. 03-17 11:30:00.009 16316 17550 I Unity   :
    3. 03-17 11:30:00.009 16316 17550 I Unity   : (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
    4. 03-17 11:30:00.009 16316 17550 I Unity   :
    5. 03-17 11:30:00.009 16316 17550 I Unity   : Unity Ads is initializing in test mode since test mode is enabled in Service Window.
    6. 03-17 11:30:00.009 16316 17550 I Unity   : UnityEngine.Advertisements.Advertisement:Initialize(String, Boolean, Boolean)
    7. 03-17 11:30:00.009 16316 17550 I Unity   : AdsController:Initialize()
    8. 03-17 11:30:00.009 16316 17550 I Unity   : MenuController:Start()
    9. 03-17 11:30:00.009 16316 17550 I Unity   :
    10. 03-17 11:30:00.009 16316 17550 I Unity   : (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
    11. 03-17 11:30:00.009 16316 17550 I Unity   :
    12. 03-17 11:30:00.030 16316 17550 I Unity   : Initialisation...
    13. 03-17 11:30:00.030 16316 17550 I Unity   : MenuController:Start()
    14. 03-17 11:30:00.030 16316 17550 I Unity   :
    15. 03-17 11:30:00.030 16316 17550 I Unity   : (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
    16. 03-17 11:30:00.030 16316 17550 I Unity   :
    17.  
    18. 03-17 11:30:00.098 16316 17550 W Unity   : UnityEngine.Purchasing.PurchasingManager:HasAvailableProductsToPurchase(Boolean)
    19. 03-17 11:30:00.098 16316 17550 W Unity   : UnityEngine.Purchasing.PurchasingManager:CheckForInitialization()
    20. 03-17 11:30:00.098 16316 17550 W Unity   : UnityEngine.Purchasing.PurchasingManager:OnProductsRetrieved(List`1)
    21. 03-17 11:30:00.098 16316 17550 W Unity   : System.Action:Invoke()
    22. 03-17 11:30:00.098 16316 17550 W Unity   : UnityEngine.Purchasing.Extension.UnityUtil:Update()
    23. 03-17 11:30:00.098 16316 17550 W Unity   :
    24. 03-17 11:30:00.098 16316 17550 W Unity   : (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
    25. 03-17 11:30:00.098 16316 17550 W Unity   :
    26.  
    27. 03-17 11:30:00.098 16316 17550 W Unity   : UnityEngine.Purchasing.PurchasingManager:HasAvailableProductsToPurchase(Boolean)
    28. 03-17 11:30:00.098 16316 17550 W Unity   : UnityEngine.Purchasing.PurchasingManager:CheckForInitialization()
    29. 03-17 11:30:00.098 16316 17550 W Unity   : UnityEngine.Purchasing.PurchasingManager:OnProductsRetrieved(List`1)
    30. 03-17 11:30:00.098 16316 17550 W Unity   : System.Action:Invoke()
    31. 03-17 11:30:00.098 16316 17550 W Unity   : UnityEngine.Purchasing.Extension.UnityUtil:Update()
    32. 03-17 11:30:00.098 16316 17550 W Unity   :
    33. 03-17 11:30:00.098 16316 17550 W Unity   : (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
    34. 03-17 11:30:00.098 16316 17550 W Unity   :
    35.  
    36. 03-17 11:30:00.099 16316 17550 W Unity   : UnityEngine.Purchasing.PurchasingManager:HasAvailableProductsToPurchase(Boolean)
    37. 03-17 11:30:00.099 16316 17550 W Unity   : UnityEngine.Purchasing.PurchasingManager:CheckForInitialization()
    38. 03-17 11:30:00.099 16316 17550 W Unity   : UnityEngine.Purchasing.PurchasingManager:OnProductsRetrieved(List`1)
    39. 03-17 11:30:00.099 16316 17550 W Unity   : System.Action:Invoke()
    40. 03-17 11:30:00.099 16316 17550 W Unity   : UnityEngine.Purchasing.Extension.UnityUtil:Update()
    41. 03-17 11:30:00.099 16316 17550 W Unity   :
    42. 03-17 11:30:00.099 16316 17550 W Unity   : (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
    43. 03-17 11:30:00.099 16316 17550 W Unity   :
    44. 03-17 11:30:00.099 16316 17550 W Unity   : UnityEngine.Purchasing.PurchasingManager:HasAvailableProductsToPurchase(Boolean)
    45. 03-17 11:30:00.099 16316 17550 W Unity   : UnityEngine.Purchasing.PurchasingManager:CheckForInitialization()
    46. 03-17 11:30:00.099 16316 17550 W Unity   : UnityEngine.Purchasing.PurchasingManager:OnProductsRetrieved(List`1)
    47. 03-17 11:30:00.099 16316 17550 W Unity   : System.Action:Invoke()
    48. 03-17 11:30:00.099 16316 17550 W Unity   : UnityEngine.Purchasing.Extension.UnityUtil:Update()
    49. 03-17 11:30:00.099 16316 17550 W Unity   :
    50. 03-17 11:30:00.099 16316 17550 W Unity   : (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
    51. 03-17 11:30:00.099 16316 17550 W Unity   :
    52. 03-17 11:30:00.100 16316 17550 I Unity   : OnInitializeFailed InitializationFailureReason:NoProductsAvailable
    53. 03-17 11:30:00.100 16316 17550 I Unity   : Purchaser:OnInitializeFailed(InitializationFailureReason)
    54. 03-17 11:30:00.100 16316 17550 I Unity   : UnityEngine.Purchasing.PurchasingManager:CheckForInitialization()
    55. 03-17 11:30:00.100 16316 17550 I Unity   : UnityEngine.Purchasing.PurchasingManager:OnProductsRetrieved(List`1)
    56. 03-17 11:30:00.100 16316 17550 I Unity   : System.Action:Invoke()
    57. 03-17 11:30:00.100 16316 17550 I Unity   : UnityEngine.Purchasing.Extension.UnityUtil:Update()
    58. 03-17 11:30:00.100 16316 17550 I Unity   :
    59. 03-17 11:30:00.100 16316 17550 I Unity   : (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
    60. 03-17 11:30:00.100 16316 17550 I Unity   :
    61. 03-17 11:30:08.089 16316 17550 I Unity   : BuyProductID FAIL. Not initialized.
    62. 03-17 11:30:08.089 16316 17550 I Unity   : UnityEngine.Events.UnityAction:Invoke()
    63. 03-17 11:30:08.089 16316 17550 I Unity   : UnityEngine.Events.UnityEvent:Invoke()
    64. 03-17 11:30:08.089 16316 17550 I Unity   : UnityEngine.EventSystems.EventFunction`1:Invoke(T1, BaseEventData)
    65. 03-17 11:30:08.089 16316 17550 I Unity   : UnityEngine.EventSystems.ExecuteEvents:Execute(GameObject, BaseEventData, EventFunction`1)
    66. 03-17 11:30:08.089 16316 17550 I Unity   : UnityEngine.EventSystems.StandaloneInputModule:ProcessTouchPress(PointerEventData, Boolean, Boolean)
    67. 03-17 11:30:08.089 16316 17550 I Unity   : UnityEngine.EventSystems.StandaloneInputModule:ProcessTouchEvents()
    68. 03-17 11:30:08.089 16316 17550 I Unity   : UnityEngine.EventSystems.StandaloneInputModule:Process()
    69. 03-17 11:30:08.089 16316 17550 I Unity   :
    70. 03-17 11:30:08.089 16316 17550 I Unity   : (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
    71. 03-17 11:30:08.089 16316 17550 I Unity   :
    Oh and finally my IAP integration in Unity :

    upload_2021-3-17_11-47-36.png


    Any help pleaaaase I'm going nuts here - stuck in this problem for 2 weeks now :(:(:(
     
    Last edited: Jun 21, 2021
  5. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    I'm not seeing "OnInitialized: PASS" in your logs, from your Debug.Log statement.
     
  6. yohanscritch

    yohanscritch

    Joined:
    Apr 30, 2020
    Posts:
    28
    You are right, the callback functions don't get called (neither success nor failure). How can I investigate on this more?
     
  7. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Are you calling initialize? Debug.Log it!
     
  8. yohanscritch

    yohanscritch

    Joined:
    Apr 30, 2020
    Posts:
    28
    I've added:

    Code (CSharp):
    1. Debug.Log("Unity Purchasing initialize");
    2.         UnityPurchasing.Initialize(this, builder);
    And my new log is :

    03-17 17:39:03.367 14674 19543 I Unity : UnityIAP Version: 3.0.1

    03-17 17:39:03.367 14674 19543 I Unity : UnityEngine.Purchasing.StandardPurchasingModule:Instance(AppStore)

    03-17 17:39:03.367 14674 19543 I Unity : Purchaser:InitializePurchasing()

    03-17 17:39:03.367 14674 19543 I Unity :

    03-17 17:39:03.367 14674 19543 I Unity : (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

    03-17 17:39:03.367 14674 19543 I Unity :

    03-17 17:39:03.378 14674 19543 I Unity : Unity Purchasing initialize

    03-17 17:39:03.378 14674 19543 I Unity : Purchaser:InitializePurchasing()

    03-17 17:39:03.378 14674 19543 I Unity :

    03-17 17:39:03.378 14674 19543 I Unity : (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

    03-17 17:39:03.378 14674 19543 I Unity :

    03-17 17:39:03.384 14674 19543 I Unity : FBandplayfabmanager start

    03-17 17:39:03.384 14674 19543 I Unity : (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

    03-17 17:39:03.384 14674 19543 I Unity :

    03-17 17:39:03.396 14674 19543 I Unity : Using Facebook Unity SDK v9.0.0 with FBAndroidSDK/9.1.0

    03-17 17:39:03.396 14674 19543 I Unity : Facebook.Unity.CompiledFacebookLoader:Start()

    03-17 17:39:03.396 14674 19543 I Unity :

    03-17 17:39:03.396 14674 19543 I Unity : (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

    03-17 17:39:03.396 14674 19543 I Unity :

    03-17 17:39:03.396 14674 19543 I Unity : Unity Purchasing initialize

    03-17 17:39:03.396 14674 19543 I Unity : Purchaser:InitializePurchasing()

    03-17 17:39:03.396 14674 19543 I Unity :

    03-17 17:39:03.396 14674 19543 I Unity : (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

    03-17 17:39:03.396 14674 19543 I Unity :

    03-17 17:39:03.400 14674 19543 I Unity : Ad supported

    03-17 17:39:03.400 14674 19543 I Unity : AdsController:Initialize()

    03-17 17:39:03.400 14674 19543 I Unity : MenuController:Start()

    03-17 17:39:03.400 14674 19543 I Unity :

    03-17 17:39:03.400 14674 19543 I Unity : (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

    03-17 17:39:03.400 14674 19543 I Unity :

    03-17 17:39:03.401 14674 19543 I Unity : Unity Ads is initializing in test mode since test mode is enabled in Service Window.

    03-17 17:39:03.401 14674 19543 I Unity : UnityEngine.Advertisements.Advertisement:Initialize(String, Boolean, Boolean)

    03-17 17:39:03.401 14674 19543 I Unity : AdsController:Initialize()

    03-17 17:39:03.401 14674 19543 I Unity : MenuController:Start()

    03-17 17:39:03.401 14674 19543 I Unity :

    03-17 17:39:03.401 14674 19543 I Unity : (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

    03-17 17:39:03.401 14674 19543 I Unity :

    03-17 17:39:03.417 14674 19543 I Unity : Initialisation...

    03-17 17:39:03.417 14674 19543 I Unity : MenuController:Start()

    03-17 17:39:03.417 14674 19543 I Unity :

    03-17 17:39:03.417 14674 19543 I Unity : (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

    03-17 17:39:03.417 14674 19543 I Unity :

    03-17 17:39:04.211 14674 19543 W Unity : Unavailable product com.jewizz.noads-com.jewizz.noads

    03-17 17:39:04.211 14674 19543 W Unity : UnityEngine.Purchasing.PurchasingManager:HasAvailableProductsToPurchase(Boolean)

    03-17 17:39:04.211 14674 19543 W Unity : UnityEngine.Purchasing.PurchasingManager:CheckForInitialization()

    03-17 17:39:04.211 14674 19543 W Unity : UnityEngine.Purchasing.PurchasingManager:OnProductsRetrieved(List`1)

    03-17 17:39:04.211 14674 19543 W Unity : System.Action:Invoke()

    03-17 17:39:04.211 14674 19543 W Unity : UnityEngine.Purchasing.Extension.UnityUtil:Update()

    03-17 17:39:04.211 14674 19543 W Unity :

    03-17 17:39:04.211 14674 19543 W Unity : (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

    03-17 17:39:04.211 14674 19543 W Unity :

    03-17 17:39:04.211 14674 19543 W Unity : Unavailable product com.jewizz.3hints-com.jewizz.3hints

    03-17 17:39:04.211 14674 19543 W Unity : UnityEngine.Purchasing.PurchasingManager:HasAvailableProductsToPurchase(Boolean)

    03-17 17:39:04.211 14674 19543 W Unity : UnityEngine.Purchasing.PurchasingManager:CheckForInitialization()

    03-17 17:39:04.211 14674 19543 W Unity : UnityEngine.Purchasing.PurchasingManager:OnProductsRetrieved(List`1)

    03-17 17:39:04.211 14674 19543 W Unity : System.Action:Invoke()

    03-17 17:39:04.211 14674 19543 W Unity : UnityEngine.Purchasing.Extension.UnityUtil:Update()

    03-17 17:39:04.211 14674 19543 W Unity :

    03-17 17:39:04.211 14674 19543 W Unity : (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

    03-17 17:39:04.211 14674 19543 W Unity :

    03-17 17:39:04.212 14674 19543 W Unity : Unavailable product com.jewizz.10hints-com.jewizz.10hints

    03-17 17:39:04.212 14674 19543 W Unity : UnityEngine.Purchasing.PurchasingManager:HasAvailableProductsToPurchase(Boolean)

    03-17 17:39:04.212 14674 19543 W Unity : UnityEngine.Purchasing.PurchasingManager:CheckForInitialization()

    03-17 17:39:04.212 14674 19543 W Unity : UnityEngine.Purchasing.PurchasingManager:OnProductsRetrieved(List`1)

    03-17 17:39:04.212 14674 19543 W Unity : System.Action:Invoke()

    03-17 17:39:04.212 14674 19543 W Unity : UnityEngine.Purchasing.Extension.UnityUtil:Update()

    03-17 17:39:04.212 14674 19543 W Unity :

    03-17 17:39:04.212 14674 19543 W Unity : (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

    03-17 17:39:04.212 14674 19543 W Unity :

    03-17 17:39:04.212 14674 19543 W Unity : Unavailable product com.jewizz.life-com.jewizz.life

    03-17 17:39:04.212 14674 19543 W Unity : UnityEngine.Purchasing.PurchasingManager:HasAvailableProductsToPurchase(Boolean)

    03-17 17:39:04.212 14674 19543 W Unity : UnityEngine.Purchasing.PurchasingManager:CheckForInitialization()

    03-17 17:39:04.212 14674 19543 W Unity : UnityEngine.Purchasing.PurchasingManager:OnProductsRetrieved(List`1)

    03-17 17:39:04.212 14674 19543 W Unity : System.Action:Invoke()

    03-17 17:39:04.212 14674 19543 W Unity : UnityEngine.Purchasing.Extension.UnityUtil:Update()

    03-17 17:39:04.212 14674 19543 W Unity :

    03-17 17:39:04.212 14674 19543 W Unity : (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

    03-17 17:39:04.212 14674 19543 W Unity :

    03-17 17:39:04.214 14674 19543 I Unity : OnInitializeFailed InitializationFailureReason:NoProductsAvailable

    03-17 17:39:04.214 14674 19543 I Unity : Purchaser:OnInitializeFailed(InitializationFailureReason)

    03-17 17:39:04.214 14674 19543 I Unity : UnityEngine.Purchasing.PurchasingManager:CheckForInitialization()

    03-17 17:39:04.214 14674 19543 I Unity : UnityEngine.Purchasing.PurchasingManager:OnProductsRetrieved(List`1)

    03-17 17:39:04.214 14674 19543 I Unity : System.Action:Invoke()

    03-17 17:39:04.214 14674 19543 I Unity : UnityEngine.Purchasing.Extension.UnityUtil:Update()

    03-17 17:39:04.214 14674 19543 I Unity :

    03-17 17:39:04.214 14674 19543 I Unity : (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

    03-17 17:39:04.214 14674 19543 I Unity :

    03-17 17:39:06.630 14674 19543 I Unity : BuyProductID FAIL. Not initialized.

    03-17 17:39:06.630 14674 19543 I Unity : UnityEngine.Events.UnityAction:Invoke()

    03-17 17:39:06.630 14674 19543 I Unity : UnityEngine.Events.UnityEvent:Invoke()

    03-17 17:39:06.630 14674 19543 I Unity : UnityEngine.EventSystems.EventFunction`1:Invoke(T1, BaseEventData)

    03-17 17:39:06.630 14674 19543 I Unity : UnityEngine.EventSystems.ExecuteEvents:Execute(GameObject, BaseEventData, EventFunction`1)

    03-17 17:39:06.630 14674 19543 I Unity : UnityEngine.EventSystems.StandaloneInputModule:processTouchPress(PointerEventData, Boolean, Boolean)

    03-17 17:39:06.630 14674 19543 I Unity : UnityEngine.EventSystems.StandaloneInputModule:processTouchEvents()

    03-17 17:39:06.630 14674 19543 I Unity : UnityEngine.EventSystems.StandaloneInputModule:process()

    03-17 17:39:06.630 14674 19543 I Unity :

    03-17 17:39:06.630 14674 19543 I Unity : (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

    03-17 17:39:06.630 14674 19543 I Unity :

    03-17 17:39:08.066 14674 19543 I Unity : BuyProductID FAIL. Not initialized.

    03-17 17:39:08.066 14674 19543 I Unity : UnityEngine.Events.UnityAction:Invoke()

    03-17 17:39:08.066 14674 19543 I Unity : UnityEngine.Events.UnityEvent:Invoke()

    03-17 17:39:08.066 14674 19543 I Unity : UnityEngine.EventSystems.EventFunction`1:Invoke(T1, BaseEventData)

    03-17 17:39:08.066 14674 19543 I Unity : UnityEngine.EventSystems.ExecuteEvents:Execute(GameObject, BaseEventData, EventFunction`1)

    03-17 17:39:08.066 14674 19543 I Unity : UnityEngine.EventSystems.StandaloneInputModule:processTouchPress(PointerEventData, Boolean, Boolean)

    03-17 17:39:08.066 14674 19543 I Unity : UnityEngine.EventSystems.StandaloneInputModule:processTouchEvents()

    03-17 17:39:08.066 14674 19543 I Unity : UnityEngine.EventSystems.StandaloneInputModule:process()

    03-17 17:39:08.066 14674 19543 I Unity :

    03-17 17:39:08.066 14674 19543 I Unity : (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

    03-17 17:39:08.066 14674 19543 I Unity :

    03-17 17:39:09.171 14674 19543 I Unity : BuyProductID FAIL. Not initialized.

    03-17 17:39:09.171 14674 19543 I Unity : UnityEngine.Events.UnityAction:Invoke()

    03-17 17:39:09.171 14674 19543 I Unity : UnityEngine.Events.UnityEvent:Invoke()

    03-17 17:39:09.171 14674 19543 I Unity : UnityEngine.EventSystems.EventFunction`1:Invoke(T1, BaseEventData)

    03-17 17:39:09.171 14674 19543 I Unity : UnityEngine.EventSystems.ExecuteEvents:Execute(GameObject, BaseEventData, EventFunction`1)

    03-17 17:39:09.171 14674 19543 I Unity : UnityEngine.EventSystems.StandaloneInputModule:processTouchPress(PointerEventData, Boolean, Boolean)

    03-17 17:39:09.171 14674 19543 I Unity : UnityEngine.EventSystems.StandaloneInputModule:processTouchEvents()

    03-17 17:39:09.171 14674 19543 I Unity : UnityEngine.EventSystems.StandaloneInputModule:process()

    03-17 17:39:09.171 14674 19543 I Unity :

    03-17 17:39:09.171 14674 19543 I Unity : (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

    03-17 17:39:09.171 14674 19543 I Unity :
     
  9. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    What are your conclusions? From initial inspection, it appears that you are initializing twice? Again, I would encourage you to test (and publish!) the Sample IAP project.
     
  10. yohanscritch

    yohanscritch

    Joined:
    Apr 30, 2020
    Posts:
    28
    Okay, thanks I had 2 scripts onto my scene, so I deleted one and now the transaction window opens but I have other errors ^^

    onPurchaseFailedEvent(productId:com.jewizz.noads message: {M: GPUL.HEC})

    03-17 21:36:18.152 19279 24984 I Unity : UnityEngine.Purchasing.PurchasingManager:OnPurchaseFailed(PurchaseFailureDescription)

    03-17 21:36:18.152 19279 24984 I Unity : System.Action:Invoke()

    03-17 21:36:18.152 19279 24984 I Unity : UnityEngine.Purchasing.Extension.UnityUtil:Update()

    03-17 21:36:18.152 19279 24984 I Unity :

    03-17 21:36:18.152 19279 24984 I Unity : (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

    03-17 21:36:18.152 19279 24984 I Unity :

    03-17 21:36:18.153 19279 24984 I Unity : OnPurchaseFailed: FAIL. Product: 'com.jewizz.noads', PurchaseFailureReason: Unknown

    03-17 21:36:18.153 19279 24984 I Unity : Purchaser:OnPurchaseFailed(Product, PurchaseFailureReason)

    03-17 21:36:18.153 19279 24984 I Unity : System.Action:Invoke()

    03-17 21:36:18.153 19279 24984 I Unity : UnityEngine.Purchasing.Extension.UnityUtil:Update()

    03-17 21:36:18.153 19279 24984 I Unity :

    03-17 21:36:18.153 19279 24984 I Unity : (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

    03-17 21:36:18.153 19279 24984 I Unity :
     
  11. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Create a couple of new products to test with, see if you still see the Unknown error. I've heard of the error before but haven't been able to reproduce. What device are you testing on, might you have a second Android device?
     
  12. yohanscritch

    yohanscritch

    Joined:
    Apr 30, 2020
    Posts:
    28
    Well, I just retrieved an old android phone from my drawer, and IAPs are now working.... Thanks a million Jeff I would not have found any of these without hour help.

    Hope this post can serve some other dude with the same problem.
     
    JeffDUnity3D likes this.
  13. Talrhyon

    Talrhyon

    Joined:
    Jun 8, 2019
    Posts:
    18
    Hi everyone, i have the same error M: GPUL.HEC failurereason Unknown on try to purchase.
    So how did you solve it ? Just by using an other phone? Is it mean purchasing will only work on some phones and not on some other?
     
  14. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    What version of Unity? I've heard of this issue on Unity 2019, can you try with Unity 2020?
     
  15. Talrhyon

    Talrhyon

    Joined:
    Jun 8, 2019
    Posts:
    18
    I have Unity AP version : 3.0.1 on Unity 2019.4.25f1.
    Its not working with an Unity 2020.3.6f1 build too.
    This is all my debug log :

    UnityIAP Version 3.0.1
    Oninitialized: PASS
    Purchasing product asychronously:'coin_50'
    purchase(coin_50)
    onPurchaseFailedEvent(productId:coin_50 message: {M:GPUL.HEC})
    OnPurchaseFailed: FAIL. Product 'coin_50', PurchaseFailurerReason: Unknown
     
  16. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
  17. Talrhyon

    Talrhyon

    Joined:
    Jun 8, 2019
    Posts:
    18
    I do a test on a Redmi 8 with an other google account and on my Oppo A72 (same error on both).
    All my tests are as Internal testing (not Closed). But i download the APK on Google Play with a link. Do you think it may be the issue?
     
  18. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    You would browse to the opt in link that is provided on your Google developer dashboard for testers. On your device, you enter this URL in your device browser, and it will allow you to join the testing program, and then provide a link to launch the Play Store app which will allow you to install the app.
     
  19. Talrhyon

    Talrhyon

    Joined:
    Jun 8, 2019
    Posts:
    18
    Yes, i did that in internal test. But nothing change still same error
     
  20. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Have you confirmed there are no Red or Yellow exclamation points on your Google dashboard? All issues (screenshots, etc) must be cleared. Also, if you want to send me a private message here, and I'll give you my tester email.
     
  21. Talrhyon

    Talrhyon

    Joined:
    Jun 8, 2019
    Posts:
    18
    In "Internal testing" its not needed to do the all APK's description.
    If i must upload my APK in "Closed testing" its needed, and google have to check my APK.
    For the moment I have only tried in "Internal testing" for measures of speed and simplicity (google already refused me a test application via "Closed testing")
     
  22. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    I always test via Closed testing. Your app refusal is likely the issue.
     
  23. Talrhyon

    Talrhyon

    Joined:
    Jun 8, 2019
    Posts:
    18
    I just create my Closed testing release, and now its under review.
    I will come back when I have tested it (if the review by google is ok)
     
  24. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Why was it rejected the first time? Did you address their concerns?
     
  25. yohanscritch

    yohanscritch

    Joined:
    Apr 30, 2020
    Posts:
    28
    As far as I reckon my solution, I just tried again with an other phone. It was a problem of cache on Google server that was keeping a incorrect state, even though I corrected it.
     
  26. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Do you have any documentation with regard to their cache issue, where did you learn this?
     
  27. yohanscritch

    yohanscritch

    Joined:
    Apr 30, 2020
    Posts:
    28
    It was just a pure speculation from myself, as I tried again the next day with my previous phone and that worked like a charm.
     
  28. Nimdanet

    Nimdanet

    Joined:
    Jan 19, 2013
    Posts:
    38
    I think this thread might be dead, but I have the same problem.

    I was using Unity 2019.2.21f1 with IAP plugin 2.2.2 (or so). Everything is already live and works fine for months. I needed the new IAP 3.0.0+ plugin to work with the new Google Billing Library (v3.1). As this version only work with newer Unity I updated my project to Unity 2019.4.28f1 and IAP plugin 3.1.0. iOS purchases are just fine but Android are giving the problem described. I didn't changed any IAP code. The version live (using Unity 2019.2 and IAP 2.2.2) is working fine both Android and iOS. The version from Internal Testing (Unity 2019.4 and IAP 3.1.0) is returning Unavailable Product for all products. It calls the OnInitializeFailed "NoProductsAvailable". We've been using Internal Testing until now and everything worked on this mode. Am I missing something? We have several devices and several QAs testing. Fails on all Android devices. They only download it from store page (Internal Testing)

    TL;DR: Updated Unity 2019.2 IAP plugin 2.2.2 (everything working) to Unity 2019.4 IAP plugin 3.1.0. iOS purchase still works and Android store initialization fail ("NoProductAvailable")
     
  29. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Please share device logs, your product initialization code, and a screenshot of the same products listed on the store.
     
  30. IAmChiagozie

    IAmChiagozie

    Joined:
    Jun 26, 2017
    Posts:
    37
    I am having the same issue but with codeless IAP. Mine returns failure reason as PurchaseFailureReason.PurchasingUnavailable. After testing on the editor, there is no problem, but users have reported being unable to purchase an item and I found out that on the build the IAP button returns PurchaseFailureReason.PurchasingUnavailable when clicked, but everything went through on the fake store without problems on the editor.

    My setup is just like this video.
    I'm on Unity 2020.3.15f2
    I use IAP 3.2.2, this is the default when I enable In app purchasing from the Services menu. And I've updated to 3.2.3 and 4.0.3...all versions always yields the same results: They work on the editor, but not on build.
     
    Gametyme likes this.
  31. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Sorry I'm not following. You mentioned users? Was IAP working in your testing, before you published? The Fake store, as the name implies, does not actually connect to a store so it's not a valid test. On iOS, you want to test via TestFlight first, on Google you'll want Closed Testing.