Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

[Solved] "Unable to cache IAP catalog..." at startup tvOS 10 (Unity IAP 1.8.2)

Discussion in 'Unity IAP' started by Nolex, Oct 11, 2016.

Thread Status:
Not open for further replies.
  1. Nolex

    Nolex

    Joined:
    Dec 10, 2010
    Posts:
    115
    Hello!

    When you start the game, in the window there are errors:

    Code (CSharp):
    1. 2016-10-11 19:15:31.875098 mygame[183:18053] [MC] System group container for systemgroup.com.apple.configurationprofiles path is /private/var/containers/Shared/SystemGroup/systemgroup.com.apple.configurationprofiles
    2. 2016-10-11 19:15:31.875770 mygame[183:18053] [MC] Reading from public effective user settings.
    3. Unable to cache IAP catalog: System.UnauthorizedAccessException: Access to the path "/Unity" is denied.
    4.   at System.IO.Directory.CreateDirectoriesInternal (System.String path) [0x00000] in <filename unknown>:0
    5.   at System.IO.Directory.CreateDirectoriesInternal (System.String path) [0x00000] in <filename unknown>:0
    6.   at System.IO.Directory.CreateDirectoriesInternal (System.String path) [0x00000] in <filename unknown>:0
    7.   at UnityEngine.Purchasing.UnityPurchasing.InstantiateCatalog (System.String storeName) [0x00000] in <filename unknown>:0
    8.   at UnityEngine.Purchasing.UnityPurchasing.Initialize (IStoreListener listener, UnityEngine.Purchasing.ConfigurationBuilder builder) [0x00000] in <filename unknown>:0
    9.   at Purchaser.InitializePurchasing () [0x00000] in <filename unknown>:0
    10.   at UnityEngine.Purchasing.IExtensionProvider.GetExtension[T] () [0x00000] in <filename unknown>:0
    11.   at UnityEngine.Purchasing.IExtensionProvider.GetExtension[T] () [0x00000] in <filename unknown>:0
    12.   at UnityEngine.Purchasing.IExtensionProvider.GetExtension[T] () [0x00000] in <filename unknown>:0
    13.   at UnityEngine.Purchasing.IExtensionProvider.GetExtension[T] () [0x00000] in <filename unknown>:0
    14. UnityEngine.Purchasing.UnityPurchasing:InstantiateCatalog(String)
    15. UnityEngine.Purchasing.UnityPurchasing:Initialize(IStoreListener, ConfigurationBuilder)
    16. Purchaser:InitializePurchasing()
    17. UnityEngine.Purchasing.IExtensionProvider:GetExtension()
    18. UnityEngine.Purchasing.IExtensionProvider:GetExtension()
    19. UnityEngine.Purchasing.IExtensionProvider:GetExtension()
    20. UnityEngine.Purchasing.IExtensionProvider:GetExtension()
    21. (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 42)
    22.  
    23. 2016-10-11 19:15:31.897446 mygame[183:18053] UnityIAP:Requesting 4 products
    24. 2016-10-11 19:15:31.923013 mygame[183:18053] UnityIAP:Requesting product data...
    25. 2016-10-11 19:15:33.721698 mygame[183:18053] UnityIAP:Received 4 products
    26. 2016-10-11 19:15:33.745148 mygame[183:18053] UnityIAP:addTransactionObserver

    In-app purchases are working well (buying works), but these errors are a bit confused.
    What does this mean and is it scary?)


    P. S. On the Google Play / iOS, everything works well and there is no such errors.

    Unity 5.4.1 (building xcode.proj in Windows 10)
    Unity IAP 1.8.2
    XCode 8.0
    tvOS 10.0

    Best,
    Nolex.
     
  2. ap-unity

    ap-unity

    Unity Technologies

    Joined:
    Aug 3, 2016
    Posts:
    1,519
    There was recently another user that had a similar error (though they were building on Android) and their issue was resolved on its own:
    https://forum.unity3d.com/threads/android-iap-error-unable-to-cache-iap-catalog.434607/

    I can ask for the same information I asked them:

    Would you be able to provide some more information about the code that is causing this error. Based on the error, it looks like a filesystem permission issue. In the debug log, what part of your script is causing this error specifically?

    Are you following the implementation guide in the Unity Manual?
    https://docs.unity3d.com/Manual/UnityIAP.html
     
  3. Nolex

    Nolex

    Joined:
    Dec 10, 2010
    Posts:
    115
    Thanks for answer!

    Yes! On the Google Play / iOS / Tizen, everything works well and there is no such errors.

    The problem in InitializePurchasing() function:

    Code (CSharp):
    1.  
    2.   public const string donate_pack_1 = "donate_pack_1"; // 1000 Coins
    3.   public const string donate_pack_2 = "donate_pack_2";
    4.   public const string donate_pack_3 = "donate_pack_3";
    5.   public const string donate_pack_4 = "donate_pack_4";
    6.   public const string donate_pack_5 = "donate_pack_5"; // 5000 Coins (tvos/tizen)
    7.  
    8.   private const string store_donate_pack_1 = "com.mycoolcompany.game.mycoolgame2_donate_pack_1"; // 1000 Coins
    9.   private const string store_donate_pack_2 = "com.mycoolcompany.game.mycoolgame2_donate_pack_2";
    10.   private const string store_donate_pack_3 = "com.mycoolcompany.game.mycoolgame2_donate_pack_3";
    11.   private const string store_donate_pack_4 = "com.mycoolcompany.game.mycoolgame2_donate_pack_4";
    12.   private const string store_donate_pack_5 = "com.mycoolcompany.game.mycoolgame2_donate_pack_5"; // 5000 Coins (tvos/tizen)
    13.  
    14. public void InitializePurchasing()
    15.     {
    16.         Main.DebugLog("InitializePurchasing is starting...");
    17.  
    18.         is_can_buy = true;
    19.  
    20.         // If we have already connected to Purchasing ...
    21.         if (IsInitialized())
    22.         {
    23.             // ... we are done here.
    24.             return;
    25.         }
    26.  
    27.         // Create a builder, first passing in a suite of Unity provided stores.
    28.         var builder = ConfigurationBuilder.Instance(StandardPurchasingModule.Instance());
    29.  
    30.         // Add a product to sell / restore by way of its identifier, associating the general identifier with its store-specific identifiers.
    31.         builder.AddProduct(donate_pack_1, ProductType.Consumable, new IDs() { { store_donate_pack_1, AppleAppStore.Name }, { store_donate_pack_1, GooglePlay.Name }, { "xxxxxxxxxx", TizenStore.Name } });
    32.         builder.AddProduct(donate_pack_3, ProductType.NonConsumable, new IDs() { { store_donate_pack_3, AppleAppStore.Name }, { store_donate_pack_3, GooglePlay.Name }, { "xxxxxxxxxxx", TizenStore.Name } });
    33.         builder.AddProduct(donate_pack_4, ProductType.NonConsumable, new IDs() { { store_donate_pack_4, AppleAppStore.Name }, { store_donate_pack_4, GooglePlay.Name }, { "xxxxxxxxxxxx", TizenStore.Name } });
    34.  
    35. #if UNITY_ANDROID || UNITY_IOS
    36.         // Remove Ads
    37.         builder.AddProduct(donate_pack_2, ProductType.NonConsumable, new IDs() { { store_donate_pack_2, AppleAppStore.Name }, { store_donate_pack_2, GooglePlay.Name } });
    38. #elif UNITY_TVOS || UNITY_TIZEN
    39.         // 5000 Coins.
    40.         builder.AddProduct(donate_pack_5, ProductType.Consumable, new IDs() { { store_donate_pack_5, AppleAppStore.Name }, { "xxxxxxxxxxxx", TizenStore.Name } });
    41. #endif
    42.  
    43.  
    44. #if UNITY_TIZEN
    45.         // required field!!!
    46.         builder.Configure<ITizenStoreConfiguration>().SetGroupId("xxxxxxxxxxxxxx");
    47. #endif
    48.  
    49. #if RECEIPT_VALIDATION
    50.         validator = new CrossPlatformValidator(GooglePlayTangle.Data(), AppleTangle.Data(), Application.bundleIdentifier);
    51. #endif
    52.  
    53.         UnityPurchasing.Initialize(this, builder);
    54.  
    55.         Main.DebugLog("InitializePurchasing is finish...");
    56.     }


    LOGS:

    Code (CSharp):
    1. InitializePurchasing is starting...
    2. Purchaser:InitializePurchasing()
    3. System.Collections.Generic.IComparer`1:Compare(T, T)
    4. System.Collections.Generic.IComparer`1:Compare(T, T)
    5. System.Collections.Generic.IComparer`1:Compare(T, T)
    6. System.Collections.Generic.IComparer`1:Compare(T, T)
    7. (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 42)
    8.  
    9. Unable to cache IAP catalog: System.UnauthorizedAccessException: Access to the path "/Unity" is denied.
    10.   at System.IO.Directory.CreateDirectoriesInternal (System.String path) [0x00000] in <filename unknown>:0
    11.   at System.IO.Directory.CreateDirectoriesInternal (System.String path) [0x00000] in <filename unknown>:0
    12.   at System.IO.Directory.CreateDirectoriesInternal (System.String path) [0x00000] in <filename unknown>:0
    13.   at UnityEngine.Purchasing.UnityPurchasing.InstantiateCatalog (System.String storeName) [0x00000] in <filename unknown>:0
    14.   at UnityEngine.Purchasing.UnityPurchasing.Initialize (IStoreListener listener, UnityEngine.Purchasing.ConfigurationBuilder builder) [0x00000] in <filename unknown>:0
    15.   at Purchaser.InitializePurchasing () [0x00000] in <filename unknown>:0
    16.   at System.Collections.Generic.IComparer`1[T].Compare (.T x, .T y) [0x00000] in <filename unknown>:0
    17.   at System.Collections.Generic.IComparer`1[T].Compare (.T x, .T y) [0x00000] in <filename unknown>:0
    18.   at System.Collections.Generic.IComparer`1[T].Compare (.T x, .T y) [0x00000] in <filename unknown>:0
    19.   at System.Collections.Generic.IComparer`1[T].Compare (.T x, .T y) [0x00000] in <filename unknown>:0
    20. UnityEngine.Purchasing.UnityPurchasing:InstantiateCatalog(String)
    21. UnityEngine.Purchasing.UnityPurchasing:Initialize(IStoreListener, ConfigurationBuilder)
    22. Purchaser:InitializePurchasing()
    23. System.Collections.Generic.IComparer`1:Compare(T, T)
    24. System.Collections.Generic.IComparer`1:Compare(T, T)
    25. System.Collections.Generic.IComparer`1:Compare(T, T)
    26. System.Collections.Generic.IComparer`1:Compare(T, T)
    27. (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 42)
    28.  
    29. 2016-10-14 13:55:47.467710 mygame[175:5727] UnityIAP:Requesting 4 products
    30. InitializePurchasing is finish...
    31. System.Collections.Generic.IComparer`1:Compare(T, T)
    32. System.Collections.Generic.IComparer`1:Compare(T, T)
    33. System.Collections.Generic.IComparer`1:Compare(T, T)
    34. System.Collections.Generic.IComparer`1:Compare(T, T)
    35.  
    36. (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 42)

    How to fix? Thank you!
     
  4. ap-unity

    ap-unity

    Unity Technologies

    Joined:
    Aug 3, 2016
    Posts:
    1,519
    @Nolex,

    One of our IAP engineers is going to look into this issue. We will let you know what we find.
     
    tinchopunk79 and Nolex like this.
  5. Nolex

    Nolex

    Joined:
    Dec 10, 2010
    Posts:
    115
    Any news? (

    The problem remained..

    I think that the plug-in can not save the metadata of Product.
    Because in function "PurchaseProcessingResult ProcessPurchase(PurchaseEventArgs args)" all metadata is null!!

    args.purchasedProduct.metadata.isoCurrencyCode === null
    args.purchasedProduct.metadata.localizedTitle === null
    args.purchasedProduct.metadata.localizedPrice === null
    ...

    Maybe problem with build in Windows 10?)
    On the Google Play / iOS / Tizen, everything works well and there is no such errors.
    Please help!

    P. S.Updated to latest versions (no change..):
    Unity 5.4.2
    Unity IAP 1.8.3
     
  6. leandrinux

    leandrinux

    Joined:
    Oct 31, 2016
    Posts:
    2
    I'm having the exact same problem as Nolex, using the exact same Unity/Unity IAP/tvOS versions. Is there an update for this issue?
     
  7. Nolex

    Nolex

    Joined:
    Dec 10, 2010
    Posts:
    115
    Hello! The problem is not solved. :(

    In-app purchases can be purchased and this is good.
    Restore in-app purchases also work.

    But meta-data in args.purchasedProduct.metadata is not working. It is null.
    (in public PurchaseProcessingResult ProcessPurchase(PurchaseEventArgs args)
     
  8. tinchopunk79

    tinchopunk79

    Joined:
    Oct 8, 2016
    Posts:
    4
    @ap-unity We have the same problem with Access to the path "/Unity"is denied. in TVOS 10. Any solution? or a workaround?

    Unity 5.4.2
    Unity IAP 1.8.3
    TVOS 10
    Xcode 8
     
  9. ap-unity

    ap-unity

    Unity Technologies

    Joined:
    Aug 3, 2016
    Posts:
    1,519
    Hi @Nolex, @leandrinux, and @tinchopunk79

    We don't have any updates on this issue yet. Our IAP engineers are currently working on it though.

    I can give you some background into the issue. Basically, tvOS does not allow apps to store persistent data on the device, so we have to work around that limitation. That is what the error is saying, we don't have access to store data in the "/Unity" folder.

    @Nolex

    The metadata is null because the products aren't initialized properly. That's where the access error is originating.

    I will update everyone when I have more information. I apologize for any inconvenience this issue has caused.
     
    leandrinux, tinchopunk79 and Nolex like this.
  10. leandrinux

    leandrinux

    Joined:
    Oct 31, 2016
    Posts:
    2
    Hey @ap-unity, thanks you a lot. We were currently evaluating to use Prime31 as a replacement but since you are telling me that they are looking into the issue, I'll wait for it! Yeah I thought it had to be related to tvOS restrictions on the local filesystem but I have no known way to workaround the issue. What's interesting is that we made a different test app and it didn't crash during the initialization.
     
  11. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,445
    It does allow save data in cloud, you could use that
     
  12. ap-unity

    ap-unity

    Unity Technologies

    Joined:
    Aug 3, 2016
    Posts:
    1,519
    Hi @Nolex, @leandrinux, and @tinchopunk79

    I wanted to give you an update about this issue. We have created a fix, but unfortunately it will require an engine update rather than an update to the plugin.

    @Nolex
    One thing I didn't notice in your code until now was that you are creating the CrossPlatformValidator in your InitializePurchasing method, but that isn't really necessary until ProcessPurchase. I don't think it is related to the issue you're seeing, but just something I noticed.
     
  13. ignacioambrois

    ignacioambrois

    Joined:
    Feb 6, 2017
    Posts:
    7
    Any update on this?
    I've encountered the same error on TvOS 10.2

    Was this addressed in an already released version of the engine?
     
    Last edited: Feb 13, 2017
  14. Nolex

    Nolex

    Joined:
    Dec 10, 2010
    Posts:
    115
  15. ap-unity

    ap-unity

    Unity Technologies

    Joined:
    Aug 3, 2016
    Posts:
    1,519
    Nolex likes this.
Thread Status:
Not open for further replies.