Search Unity

Unity IAP UWP throws exception during init

Discussion in 'Unity IAP' started by gww2, Sep 16, 2021.

  1. gww2

    gww2

    Joined:
    Jan 13, 2017
    Posts:
    21
    We have a UWP build of our game that uses Unity IAP to manage our subscription. This is working fine in iOS and android. After setting up our UWP build to run off of the actual store data we get an error on initialization:

    Code (CSharp):
    1. info:LoadListingInformationAsync() invoked.    [Windows::ApplicationModel::Store::CurrentAppFactory::LoadListingInformationAsync]
    2. Exception thrown at 0x00007FFA86BC4F99 in GameName.exe: Microsoft C++ exception: Il2CppExceptionWrapper at memory location 0x000000F82CCF8A10.
    3. info:GetUnfulfilledConsumablesAsync() invoked.    [Windows::ApplicationModel::Store::CurrentAppFactory::GetUnfulfilledConsumablesAsync]
    4. Exception thrown at 0x00007FFA86BC4F99 in GameName.exe: Microsoft C++ exception: Il2CppExceptionWrapper at memory location 0x000000F82CAFD960.
    5. Exception thrown at 0x00007FFA86BC4F99 in GameName.exe: Microsoft C++ exception: Il2CppExceptionWrapper at memory location 0x000000F82CAFBE20.
    6. Unity Purchasing: UnityIAPWin8:PollForProducts() Exception (persistent = True, delay = 0, retry = 30), exception: Exception of type 'System.Exception' was thrown.
    7. UnityEngine.DebugLogHandler:Internal_Log(LogType, LogOption, String, Object)
    8. UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
    9. UnityEngine.Logger:LogError(String, Object)
    10. UnityEngine.Purchasing.WinRTStore:logError(String)
    11. UnityEngine.Purchasing.Default.WinRTStore:LogError(String, Object[])
    12. UnityEngine.Purchasing.Default.<PollForProducts>d__10:MoveNext()
    13. System.Runtime.CompilerServices.MoveNextRunner:InvokeMoveNext(Object)
    14. System.Threading.ContextCallback:Invoke(Object)
    15. System.Threading.ExecutionContext:RunInternal(ExecutionContext, ContextCallback, Object, Boolean)
    16. System.Threading.ExecutionContext:Run(ExecutionContext, ContextCallback, Object, Boolean)
    17. System.Runtime.CompilerServices.MoveNextRunner:Run()
    18. System.Action:Invoke()
    19. System.Threading.Tasks.AwaitTaskContinuation:InvokeAction(Object)
    20. System.Threading.ContextCallback:Invoke(Object)
    21. System.Threading.Tasks.AwaitTaskContinuation:RunCallback(ContextCallback, Object, Task&)
    22. System.Threading.Tasks.SynchronizationContextAwaitTaskContinuation:Run(Task, Boolean)
    23. System.Threading.Tasks.Task:FinishContinuations()
    24. System.Threading.Tasks.Task:FinishStageThree()
    25. System.Threading.Tasks.Task:FinishStageTwo()
    26. System.Threading.Tasks.Task:Finish(Boolean)
    27. System.Threading.Tasks.Task`1:TrySetException(Object)
    28. System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1:SetException(Exception)
    29. UnityEngine.Purchasing.Default.<DoRetrieveProducts>d__11:MoveNext()
    30. System.Runtime.CompilerServices.MoveNextRunner:InvokeMoveNext(Object)
    31. System.Threading.ContextCallback:Invoke(Object)
    32. System.Threading.ExecutionContext:RunInternal(ExecutionContext, ContextCallback, Object, Boolean)
    33. System.Threading.ExecutionContext:Run(ExecutionContext, ContextCallback, Object, Boolean)
    34. System.Runtime.CompilerServices.MoveNextRunner:Run()
    35. System.Action:Invoke()
    36. System.Threading.Tasks.<>c:<.cctor>b__7_0(Object)
    37. System.Threading.SendOrPostCallback:Invoke(Object)
    38. System.Threading.InvocationContext:Invoke()
    39. System.Threading.OSSpecificSynchronizationContext:InvocationEntry(IntPtr)
    Our Microsoft store setup seems fine and we're running Unity IAP 4.0.3. We tried a handful of other versions and consistently saw the same inability to get past initialization. I've seen a few other posts about initialization difficulties with UWP specifically, but its difficult to see/understand if there is any resolution or if this is even the same issue.

    We're running Unity 2019.4.28f1 at the moment.
     
    Last edited: Sep 16, 2021
  2. PeachyPixels

    PeachyPixels

    Joined:
    Feb 17, 2018
    Posts:
    713
    Last edited: Sep 24, 2021
  3. gww2

    gww2

    Joined:
    Jan 13, 2017
    Posts:
    21
    Thank you so much for reaching out! I had read through that one and it didn't resolve the issue. I finally figured out what I had missed. I had the wrong content type setting selected on the properties. After fixing that and it being approved I was getting the NoProductsFound init failure for at least a day. Now a couple days later it works as expected. What a process...
     
    PeachyPixels likes this.
  4. PeachyPixels

    PeachyPixels

    Joined:
    Feb 17, 2018
    Posts:
    713
    Thanks for the update.

    Yes MS Store Support is not the best with Unity.

    I think it's using an older MS SDK\API, but they mentioned it is being looked at and hopefully modernised. So fingers crossed it's sooner rather than later, especially with Windows 11 almost upon us.
     
  5. gww2

    gww2

    Joined:
    Jan 13, 2017
    Posts:
    21
    I may have spoken too soon, mock billing may have gotten enabled at one point which is why it appears to work. Stuck for now with NoProductsAvailable with a subscription definitely defined properly on the windows side. Will continue to tinker with settings/options. Would be nice to get a definitive answer if this even works from Unity IAP.
     
  6. gww2

    gww2

    Joined:
    Jan 13, 2017
    Posts:
    21
    It appears to be an issue with retrieving the products still:

    info:LoadListingInformationAsync() invoked. [Windows::ApplicationModel::Store::CurrentAppFactory::LoadListingInformationAsync]
    Exception thrown at 0x00007FFCD7DF4F99 in APPNAME.exe: Microsoft C++ exception: Il2CppExceptionWrapper at memory location 0x0000007A572F8C40.
    info:GetUnfulfilledConsumablesAsync() invoked. [Windows::ApplicationModel::Store::CurrentAppFactory::GetUnfulfilledConsumablesAsync]
    info:GetAppReceiptAsync() invoked. [Windows::ApplicationModel::Store::CurrentAppFactory::GetAppReceiptAsync]
    info:get_LicenseInformation() invoked. [Windows::ApplicationModel::Store::CurrentAppFactory::get_LicenseInformation]

    This exception appears to kill the product retrieval process which then leaves my product as unavailable since it never pulled any information down about it.
     
  7. gww2

    gww2

    Joined:
    Jan 13, 2017
    Posts:
    21
    Issue still exists with 4.1

    Exception thrown at 0x00007FFD0A714F99 in APPNAME.exe: Microsoft C++ exception: Il2CppExceptionWrapper at memory location 0x0000002D8CFF8C00.
    info:GetUnfulfilledConsumablesAsync() invoked. [Windows::ApplicationModel::Store::CurrentAppFactory::GetUnfulfilledConsumablesAsync]
    info:GetAppReceiptAsync() invoked. [Windows::ApplicationModel::Store::CurrentAppFactory::GetAppReceiptAsync]
    info:get_LicenseInformation() invoked. [Windows::ApplicationModel::Store::CurrentAppFactory::get_LicenseInformation]
     
    waltran likes this.