Search Unity

Unity IAP 1.18.0 crashes on initialization on tvOS

Discussion in 'Unity IAP' started by PStal, Apr 20, 2018.

  1. PStal

    PStal

    Joined:
    Dec 14, 2013
    Posts:
    5
    Hi,

    Checked the issue for some time. In tvOS version when I upgraded IAP plugin to 1.18.0 I have such crash after calling: UnityPurchasing.Initialize(this, builder) in xCode:

    NullReferenceException: A null value was found where an object instance was required.
    at UnityEngine.Purchasing.StoreCatalogImpl+<>c__DisplayClass10_0.<FetchProducts>b__1 (System.String error) [0x00000] in <filename unknown>:0

    Whole callstack and logs from xCode:


    Unable to cache IAP catalog: System.UnauthorizedAccessException: Access to the path "/Unity" is denied.

    at System.IO.DirectoryInfo..ctor (System.String path, Boolean simpleOriginalPath) [0x00000] in <filename unknown>:0

    at System.IO.Directory.CreateDirectoriesInternal (System.String path) [0x00000] in <filename unknown>:0

    at System.IO.Directory.CreateDirectoriesInternal (System.String path) [0x00000] in <filename unknown>:0

    at UnityEngine.Purchasing.UnityPurchasing.InstantiateCatalog (System.String storeName) [0x00000] in <filename unknown>:0

    at UnityEngine.Purchasing.UnityPurchasing.Initialize (IStoreListener listener, UnityEngine.Purchasing.ConfigurationBuilder builder) [0x00000] in <filename unknown>:0

    UnityEngine.Purchasing.UnityPurchasing:InstantiateCatalog(String)

    UnityEngine.Purchasing.UnityPurchasing:Initialize(IStoreListener, ConfigurationBuilder)



    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)



    Unable to createInstance of FileReference Class: : System.UnauthorizedAccessException: Access to the path "/Unity" is denied.

    at System.IO.DirectoryInfo..ctor (System.String path, Boolean simpleOriginalPath) [0x00000] in <filename unknown>:0

    at System.IO.Directory.CreateDirectoriesInternal (System.String path) [0x00000] in <filename unknown>:0

    at System.IO.Directory.CreateDirectoriesInternal (System.String path) [0x00000] in <filename unknown>:0

    at UnityEngine.Purchasing.FileReference.CreateInstance (System.String filename, ILogger logger) [0x00000] in <filename unknown>:0

    at UnityEngine.Purchasing.StoreCatalogImpl.CreateInstance (System.String storeName, System.String baseUrl, ILogger logger) [0x00000] in <filename unknown>:0

    at UnityEngine.Purchasing.JSONStore.Initialize (IStoreCallback callback) [0x00000] in <filename unknown>:0

    at UnityEngine.Purchasing.PurchasingManager.Initialize (IInternalStoreListener listener, System.Collections.Generic.HashSet`1 products) [0x00000] in <filename unknown>:0

    UnityEngine.Purchasing.FileReference:CreateInstance(String, ILogger)

    UnityEngine.Purchasing.StoreCatalogImpl:CreateInstance(String, String, ILogger)

    UnityEngine.Purchasing.JSONStore:Initialize(IStoreCallback)

    UnityEngine.Purchasing.PurchasingManager:Initialize(IInternalStoreListener, HashSet`1)



    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)



    Fetching optimized store details from https://ecommerce.iap.unity3d.com/c...E6D77&userid=e5a183d6018a54bec9f74d1095a49c22

    UnityEngine.Purchasing.StoreCatalogImpl:FetchProducts(Action`1)

    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)


    NullReferenceException: A null value was found where an object instance was required.

    at UnityEngine.Purchasing.StoreCatalogImpl+<>c__DisplayClass10_0.<FetchProducts>b__1 (System.String error) [0x00000] in <filename unknown>:0

    at UnityEngine.Purchasing.AsyncWebUtil+<Process>d__4.MoveNext () [0x00000] in <filename unknown>:0

    at UnityEngine.SetupCoroutine.InvokeMoveNext (IEnumerator enumerator, IntPtr returnValueAddress) [0x00000] in <filename unknown>:0

    (Filename: currently not available on il2cpp Line: -1)


    This does not happen when using IAP 1.17.0
    On iOS everyting works fine (also with 1.18.0) - this happens only on tvOS (11.3)
    Unity version 5.6.5p3
     
    Deleted User likes this.
  2. JeffDUnity3D

    JeffDUnity3D

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

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Were you able to test IAP 1.17? Also, is this a crashing exception, that is, you are not able to make purchases.
     
  4. PStal

    PStal

    Joined:
    Dec 14, 2013
    Posts:
    5
    @JeffDUnity3D with IAP 1.17 I'm able to make purchases on Apple TV.
    There is such error "Unable to cache IAP catalog: System.UnauthorizedAccessException: Access to the path "/Unity" is denied." also but there's no crash and purchases can be done. So I've copied IAP 1.17 from previous project and for now I'm using it. Hope you'll be able to fix crash in IAP 1.18.
    I think the difference is here and this crashes indeed:
    NullReferenceException: A null value was found where an object instance was required.

    at UnityEngine.Purchasing.StoreCatalogImpl+<>c__DisplayClass10_0.<FetchProducts>b__1 (System.String error) [0x00000] in <filename unknown>:0

    at UnityEngine.Purchasing.AsyncWebUtil+<Process>d__4.MoveNext () [0x00000] in <filename unknown>:0

    at UnityEngine.SetupCoroutine.InvokeMoveNext (IEnumerator enumerator, IntPtr returnValueAddress) [0x00000] in <filename unknown>:0