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

Hi there,

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

03-07 20:50:31.318 25813 26688 W Unity   : Unavailable product com.mygame.noads-com.mygame.noads
03-07 20:50:31.318 25813 26688 W Unity   : UnityEngine.Purchasing.PurchasingManager:HasAvailableProductsToPurchase(Boolean)
03-07 20:50:31.318 25813 26688 W Unity   : UnityEngine.Purchasing.PurchasingManager:CheckForInitialization()
03-07 20:50:31.318 25813 26688 W Unity   : UnityEngine.Purchasing.PurchasingManager:OnProductsRetrieved(List`1)
03-07 20:50:31.318 25813 26688 W Unity   : System.Action:Invoke()
03-07 20:50:31.318 25813 26688 W Unity   : UnityEngine.Purchasing.Extension.UnityUtil:Update()

And this is how looks my products on Google Console:

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?

Did you download via Google Play for this test? You might want to compare to the Sample IAP Project Sample IAP Project and follow the (mostly correct) directions here Unity - Manual: Configuring for Google Play Store

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.

1 Like

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 :

In my code :

using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Purchasing;

// Deriving the Purchaser class from IStoreListener enables it to receive messages from Unity Purchasing.
public class Purchaser : MonoBehaviour, IStoreListener
{
    private static IStoreController m_StoreController;          // The Unity Purchasing system.
    private static IExtensionProvider m_StoreExtensionProvider; // The store-specific Purchasing subsystems.

    // Product identifiers for all products capable of being purchased:
    // "convenience" general identifiers for use with Purchasing, and their store-specific identifier
    // counterparts for use with and outside of Unity Purchasing. Define store-specific identifiers
    // also on each platform's publisher dashboard (iTunes Connect, Google Play Developer Console, etc.)


    public ProductStore PS;


    void Start()
    {
        // If we haven't set up the Unity Purchasing reference
        if (m_StoreController == null)
        {
            // Begin to configure our connection to Purchasing
            InitializePurchasing();
        }
    }

    public void InitializePurchasing()
    {
        // If we have already connected to Purchasing ...
        if (IsInitialized())
        {
            // ... we are done here.

            return;
        }

        // Create a builder, first passing in a suite of Unity provided stores.
        var builder = ConfigurationBuilder.Instance(StandardPurchasingModule.Instance());

        // Products initialization

        builder.AddProduct(noAdsID, ProductType.NonConsumable);

        builder.AddProduct(threeclueID, ProductType.Consumable);
        builder.AddProduct(tenclueID, ProductType.Consumable);
        builder.AddProduct(lifeID, ProductType.Consumable);


        // 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);
    }


    private bool IsInitialized()
    {
        // Only say we are initialized if both the Purchasing references are set.
        return m_StoreController != null && m_StoreExtensionProvider != null;
    }


    public void BuyThreeClue()
    {
        BuyProductID(threeclueID);
    }

    public void BuyTenClue()
    {
        BuyProductID(tenclueID);
    }

    public void BuyOneLife()
    {
        BuyProductID(lifeID);
    }

    public void BuyNoAds()
    {
        BuyProductID(noAdsID);
    }

    void BuyProductID(string productId)
    {
        // If Purchasing has been initialized ...
        if (IsInitialized())
        {
            // ... look up the Product reference with the general product identifier and the Purchasing
            // system's products collection.
            Product product = m_StoreController.products.WithID(productId);

            // If the look up found a product for this device's store and that product is ready to be sold ...
            if (product != null && product.availableToPurchase)
            {
                Debug.Log(string.Format("Purchasing product asychronously: '{0}'", product.definition.id));
                // ... buy the product. Expect a response either through ProcessPurchase or OnPurchaseFailed
                // asynchronously.
                m_StoreController.InitiatePurchase(product);
            }
            // Otherwise ...
            else
            {
                // ... report the product look-up failure situation
                Debug.Log("BuyProductID: FAIL. Not purchasing product, either is not found or is not available for purchase");
            }
        }
        // Otherwise ...
        else
        {
            // ... report the fact Purchasing has not succeeded initializing yet. Consider waiting longer or
            // retrying initiailization.
            Debug.Log("BuyProductID FAIL. Not initialized.");
        }
    }


    // Restore purchases previously made by this customer. Some platforms automatically restore purchases, like Google.
    // Apple currently requires explicit purchase restoration for IAP, conditionally displaying a password prompt.
    public void RestorePurchases()
    {
        // If Purchasing has not yet been set up ...
        if (!IsInitialized())
        {
            // ... report the situation and stop restoring. Consider either waiting longer, or retrying initialization.
            Debug.Log("RestorePurchases FAIL. Not initialized.");
            return;
        }

        // If we are running on an Apple device ...
        if (Application.platform == RuntimePlatform.IPhonePlayer ||
            Application.platform == RuntimePlatform.OSXPlayer)
        {
            // ... begin restoring purchases
            Debug.Log("RestorePurchases started ...");

            // Fetch the Apple store-specific subsystem.
            var apple = m_StoreExtensionProvider.GetExtension<IAppleExtensions>();
            // Begin the asynchronous process of restoring purchases. Expect a confirmation response in
            // the Action<bool> below, and ProcessPurchase if there are previously purchased products to restore.
            apple.RestoreTransactions((result) => {
                // The first phase of restoration. If no more responses are received on ProcessPurchase then
                // no purchases are available to be restored.
                Debug.Log("RestorePurchases continuing: " + result + ". If no further messages, no purchases available to restore.");
            });
        }
        // Otherwise ...
        else
        {
            // We are not running on an Apple device. No work is necessary to restore purchases.
            Debug.Log("RestorePurchases FAIL. Not supported on this platform. Current = " + Application.platform);
        }
    }


    //
    // --- IStoreListener
    //

    public void OnInitialized(IStoreController controller, IExtensionProvider extensions)
    {
        // Purchasing has succeeded initializing. Collect our Purchasing references.
        Debug.Log("OnInitialized: PASS");

        // Overall Purchasing system, configured with products for this application.
        m_StoreController = controller;
        // Store specific subsystem, for accessing device-specific store features.
        m_StoreExtensionProvider = extensions;
    }


    public void OnInitializeFailed(InitializationFailureReason error)
    {
        // Purchasing set-up has not succeeded. Check error for reason. Consider sharing this reason with the user.
        Debug.Log("OnInitializeFailed InitializationFailureReason:" + error);
    }


    public PurchaseProcessingResult ProcessPurchase(PurchaseEventArgs args)
    {

        if (String.Equals(args.purchasedProduct.definition.id, threeclueID, StringComparison.Ordinal))
        {
            PS.AddClue(3);
        }

        if (String.Equals(args.purchasedProduct.definition.id, tenclueID, StringComparison.Ordinal))
        {
            PS.AddClue(10);
        }

        if (String.Equals(args.purchasedProduct.definition.id, lifeID, StringComparison.Ordinal))
        {
            PS.AddLife(1);
        }
        if (String.Equals(args.purchasedProduct.definition.id, noAdsID, StringComparison.Ordinal))
        {
            PS.AddNoAds();
        }

        // Return a flag indicating whether this product has completely been received, or if the application needs
        // to be reminded of this purchase at next app launch. Use PurchaseProcessingResult.Pending when still
        // saving purchased products to the cloud, and when that save is delayed.
        return PurchaseProcessingResult.Complete;
    }


    public void OnPurchaseFailed(Product product, PurchaseFailureReason failureReason)
    {
        // A product purchase attempt did not succeed. Check failureReason for more detail. Consider sharing
        // this reason with the user to guide their troubleshooting actions.
        Debug.Log(string.Format("OnPurchaseFailed: FAIL. Product: '{0}', PurchaseFailureReason: {1}", product.definition.storeSpecificId, failureReason));
    }
}

When running in editor:

And console when running from device with tester account:

03-17 11:30:00.009 16316 17550 I Unity   : MenuController:Start()
03-17 11:30:00.009 16316 17550 I Unity   :
03-17 11:30:00.009 16316 17550 I Unity   : (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
03-17 11:30:00.009 16316 17550 I Unity   :
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.
03-17 11:30:00.009 16316 17550 I Unity   : UnityEngine.Advertisements.Advertisement:Initialize(String, Boolean, Boolean)
03-17 11:30:00.009 16316 17550 I Unity   : AdsController:Initialize()
03-17 11:30:00.009 16316 17550 I Unity   : MenuController:Start()
03-17 11:30:00.009 16316 17550 I Unity   :
03-17 11:30:00.009 16316 17550 I Unity   : (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
03-17 11:30:00.009 16316 17550 I Unity   :
03-17 11:30:00.030 16316 17550 I Unity   : Initialisation...
03-17 11:30:00.030 16316 17550 I Unity   : MenuController:Start()
03-17 11:30:00.030 16316 17550 I Unity   :
03-17 11:30:00.030 16316 17550 I Unity   : (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
03-17 11:30:00.030 16316 17550 I Unity   :

03-17 11:30:00.098 16316 17550 W Unity   : UnityEngine.Purchasing.PurchasingManager:HasAvailableProductsToPurchase(Boolean)
03-17 11:30:00.098 16316 17550 W Unity   : UnityEngine.Purchasing.PurchasingManager:CheckForInitialization()
03-17 11:30:00.098 16316 17550 W Unity   : UnityEngine.Purchasing.PurchasingManager:OnProductsRetrieved(List`1)
03-17 11:30:00.098 16316 17550 W Unity   : System.Action:Invoke()
03-17 11:30:00.098 16316 17550 W Unity   : UnityEngine.Purchasing.Extension.UnityUtil:Update()
03-17 11:30:00.098 16316 17550 W Unity   :
03-17 11:30:00.098 16316 17550 W Unity   : (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
03-17 11:30:00.098 16316 17550 W Unity   :

03-17 11:30:00.098 16316 17550 W Unity   : UnityEngine.Purchasing.PurchasingManager:HasAvailableProductsToPurchase(Boolean)
03-17 11:30:00.098 16316 17550 W Unity   : UnityEngine.Purchasing.PurchasingManager:CheckForInitialization()
03-17 11:30:00.098 16316 17550 W Unity   : UnityEngine.Purchasing.PurchasingManager:OnProductsRetrieved(List`1)
03-17 11:30:00.098 16316 17550 W Unity   : System.Action:Invoke()
03-17 11:30:00.098 16316 17550 W Unity   : UnityEngine.Purchasing.Extension.UnityUtil:Update()
03-17 11:30:00.098 16316 17550 W Unity   :
03-17 11:30:00.098 16316 17550 W Unity   : (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
03-17 11:30:00.098 16316 17550 W Unity   :

03-17 11:30:00.099 16316 17550 W Unity   : UnityEngine.Purchasing.PurchasingManager:HasAvailableProductsToPurchase(Boolean)
03-17 11:30:00.099 16316 17550 W Unity   : UnityEngine.Purchasing.PurchasingManager:CheckForInitialization()
03-17 11:30:00.099 16316 17550 W Unity   : UnityEngine.Purchasing.PurchasingManager:OnProductsRetrieved(List`1)
03-17 11:30:00.099 16316 17550 W Unity   : System.Action:Invoke()
03-17 11:30:00.099 16316 17550 W Unity   : UnityEngine.Purchasing.Extension.UnityUtil:Update()
03-17 11:30:00.099 16316 17550 W Unity   :
03-17 11:30:00.099 16316 17550 W Unity   : (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
03-17 11:30:00.099 16316 17550 W Unity   :
03-17 11:30:00.099 16316 17550 W Unity   : UnityEngine.Purchasing.PurchasingManager:HasAvailableProductsToPurchase(Boolean)
03-17 11:30:00.099 16316 17550 W Unity   : UnityEngine.Purchasing.PurchasingManager:CheckForInitialization()
03-17 11:30:00.099 16316 17550 W Unity   : UnityEngine.Purchasing.PurchasingManager:OnProductsRetrieved(List`1)
03-17 11:30:00.099 16316 17550 W Unity   : System.Action:Invoke()
03-17 11:30:00.099 16316 17550 W Unity   : UnityEngine.Purchasing.Extension.UnityUtil:Update()
03-17 11:30:00.099 16316 17550 W Unity   :
03-17 11:30:00.099 16316 17550 W Unity   : (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
03-17 11:30:00.099 16316 17550 W Unity   :
03-17 11:30:00.100 16316 17550 I Unity   : OnInitializeFailed InitializationFailureReason:NoProductsAvailable
03-17 11:30:00.100 16316 17550 I Unity   : Purchaser:OnInitializeFailed(InitializationFailureReason)
03-17 11:30:00.100 16316 17550 I Unity   : UnityEngine.Purchasing.PurchasingManager:CheckForInitialization()
03-17 11:30:00.100 16316 17550 I Unity   : UnityEngine.Purchasing.PurchasingManager:OnProductsRetrieved(List`1)
03-17 11:30:00.100 16316 17550 I Unity   : System.Action:Invoke()
03-17 11:30:00.100 16316 17550 I Unity   : UnityEngine.Purchasing.Extension.UnityUtil:Update()
03-17 11:30:00.100 16316 17550 I Unity   :
03-17 11:30:00.100 16316 17550 I Unity   : (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
03-17 11:30:00.100 16316 17550 I Unity   :
03-17 11:30:08.089 16316 17550 I Unity   : BuyProductID FAIL. Not initialized.
03-17 11:30:08.089 16316 17550 I Unity   : UnityEngine.Events.UnityAction:Invoke()
03-17 11:30:08.089 16316 17550 I Unity   : UnityEngine.Events.UnityEvent:Invoke()
03-17 11:30:08.089 16316 17550 I Unity   : UnityEngine.EventSystems.EventFunction`1:Invoke(T1, BaseEventData)
03-17 11:30:08.089 16316 17550 I Unity   : UnityEngine.EventSystems.ExecuteEvents:Execute(GameObject, BaseEventData, EventFunction`1)
03-17 11:30:08.089 16316 17550 I Unity   : UnityEngine.EventSystems.StandaloneInputModule:ProcessTouchPress(PointerEventData, Boolean, Boolean)
03-17 11:30:08.089 16316 17550 I Unity   : UnityEngine.EventSystems.StandaloneInputModule:ProcessTouchEvents()
03-17 11:30:08.089 16316 17550 I Unity   : UnityEngine.EventSystems.StandaloneInputModule:Process()
03-17 11:30:08.089 16316 17550 I Unity   :
03-17 11:30:08.089 16316 17550 I Unity   : (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
03-17 11:30:08.089 16316 17550 I Unity   :

Oh and finally my IAP integration in Unity :

Any help pleaaaase I’m going nuts here - stuck in this problem for 2 weeks now :(:(:frowning:

I’m not seeing ā€œOnInitialized: PASSā€ in your logs, from your Debug.Log statement.

You are right, the callback functions don’t get called (neither success nor failure). How can I investigate on this more?

Are you calling initialize? Debug.Log it!

I’ve added:

Debug.Log("Unity Purchasing initialize");
        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 :

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.

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 :

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?

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.

1 Like

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?

What version of Unity? I’ve heard of this issue on Unity 2019, can you try with Unity 2020?

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

What Android device are you testing on? Can you create a new test user? And you are downloading your game to test via Google Play correct? You’ll want to ensure to follow the steps here https://docs.unity3d.com/Packages/com.unity.purchasing@3.2/manual/UnityIAPGoogleConfiguration.html

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?

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.

Yes, i did that in internal test. But nothing change still same error

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.