Search Unity

UnityPurchasing & il2cpp on standalone mac error

Discussion in 'Unity IAP' started by matt_unity258, Nov 27, 2018.

  1. matt_unity258

    matt_unity258

    Joined:
    Dec 4, 2017
    Posts:
    18
    Hi,
    When trying to build standalone mac with scripting backend set to IL2CPP the build fails unless I delete the Assets\Plugins\UnityPurchasing Folder. (Unity version Unity_2018.2.17f1)

    Any ideas why this is happening or if there's an elegant way to ignore the folder?

    part of the error I see is:
    il2cpp.exe didn't catch exception: Unity.IL2CPP.Building.BuilderFailedException:

    Thanks in Advance
     
  2. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,938
    Please check in the editor log file, there should be more information about the failure there. Can you post more details about the specific error message?
     
  3. matt_unity258

    matt_unity258

    Joined:
    Dec 4, 2017
    Posts:
    18
    Does this help?


    Undefined symbols for architecture x86_64:
    "_getUnityPurchasingAppReceipt", referenced from:
    _iOSStoreBindings_getUnityPurchasingAppReceipt_m4103466157 in 51021C4E05B526C3D173876EEAB014CE.o
    _iOSStoreBindings_get_appReceipt_m2498480463 in 51021C4E05B526C3D173876EEAB014CE.o
    (maybe you meant: _OSXStoreBindings_getUnityPurchasingAppReceipt_m643976844, _iOSStoreBindings_getUnityPurchasingAppReceipt_m4103466157 )
    "_unityPurchasingInterceptPromotionalPurchases", referenced from:
    _OSXStoreBindings_unityPurchasingInterceptPromotionalPurchases_m3411166610 in 51021C4E05B526C3D173876EEAB014CE.o
    _OSXStoreBindings_InterceptPromotionalPurchases_m769580797 in 51021C4E05B526C3D173876EEAB014CE.o
    _iOSStoreBindings_unityPurchasingInterceptPromotionalPurchases_m421098356 in 51021C4E05B526C3D173876EEAB014CE.o
    _iOSStoreBindings_InterceptPromotionalPurchases_m2936449487 in 51021C4E05B526C3D173876EEAB014CE.o
    (maybe you meant: _iOSStoreBindings_unityPurchasingInterceptPromotionalPurchases_m421098356, _OSXStoreBindings_unityPurchasingInterceptPromotionalPurchases_m3411166610 )
    "_unityPurchasingRetrieveProducts", referenced from:
    _iOSStoreBindings_unityPurchasingRetrieveProducts_m1942317051 in 51021C4E05B526C3D173876EEAB014CE.o
    _iOSStoreBindings_RetrieveProducts_m3230380609 in 51021C4E05B526C3D173876EEAB014CE.o
    (maybe you meant: _OSXStoreBindings_unityPurchasingRetrieveProducts_m689081799, _iOSStoreBindings_unityPurchasingRetrieveProducts_m1942317051 )
    "_unityPurchasingPurchase", referenced from:
    _iOSStoreBindings_unityPurchasingPurchase_m127163060 in 51021C4E05B526C3D173876EEAB014CE.o
    _iOSStoreBindings_Purchase_m925077806 in 51021C4E05B526C3D173876EEAB014CE.o
    (maybe you meant: _OSXStoreBindings_unityPurchasingPurchase_m1987719083, _iOSStoreBindings_unityPurchasingPurchase_m127163060 )
    "_unityPurchasingRestoreTransactions", referenced from:
    _iOSStoreBindings_unityPurchasingRestoreTransactions_m2532953743 in 51021C4E05B526C3D173876EEAB014CE.o
    _iOSStoreBindings_RestoreTransactions_m2847613056 in 51021C4E05B526C3D173876EEAB014CE.o
    (maybe you meant: _OSXStoreBindings_unityPurchasingRestoreTransactions_m3672818507, _iOSStoreBindings_unityPurchasingRestoreTransactions_m2532953743 )
    "_setUnityPurchasingCallback", referenced from:
    _iOSStoreBindings_setUnityPurchasingCallback_m1482920455 in 51021C4E05B526C3D173876EEAB014CE.o
    _iOSStoreBindings_SetUnityPurchasingCallback_m756868915 in 51021C4E05B526C3D173876EEAB014CE.o
    (maybe you meant: _OSXStoreBindings_setUnityPurchasingCallback_m3551531614, _iOSStoreBindings_setUnityPurchasingCallback_m1482920455 )
    "_unityPurchasingAddTransactionObserver", referenced from:
    _iOSStoreBindings_unityPurchasingAddTransactionObserver_m463851353 in 51021C4E05B526C3D173876EEAB014CE.o
    _iOSStoreBindings_AddTransactionObserver_m621098447 in 51021C4E05B526C3D173876EEAB014CE.o
    (maybe you meant: _OSXStoreBindings_unityPurchasingAddTransactionObserver_m1174623098, _iOSStoreBindings_unityPurchasingAddTransactionObserver_m463851353 )
    "_unityPurchasingFinishTransaction", referenced from:
    _iOSStoreBindings_unityPurchasingFinishTransaction_m1779103950 in 51021C4E05B526C3D173876EEAB014CE.o
    _iOSStoreBindings_FinishTransaction_m601113037 in 51021C4E05B526C3D173876EEAB014CE.o
    (maybe you meant: _iOSStoreBindings_unityPurchasingFinishTransaction_m1779103950, _OSXStoreBindings_unityPurchasingFinishTransaction_m3734261221 )
    ld: symbol(s) not found for architecture x86_64


    at Unity.IL2CPP.Building.CppProgramBuilder.PostprocessObjectFiles(HashSet`1 objectFiles, CppToolChainContext toolChainContext)
    at Unity.IL2CPP.Building.CppProgramBuilder.Build(IBuildStatistics& statistics)
    at il2cpp.Program.DoRun(String[] args)
    at il2cpp.Program.Run(String[] args)
    at il2cpp.Program.Main(String[] args)



    and


    Undefined symbols for architecture x86_64:
    "_getUnityPurchasingAppReceipt", referenced from:
    _iOSStoreBindings_getUnityPurchasingAppReceipt_m4103466157 in 51021C4E05B526C3D173876EEAB014CE.o
    _iOSStoreBindings_get_appReceipt_m2498480463 in 51021C4E05B526C3D173876EEAB014CE.o
    (maybe you meant: _OSXStoreBindings_getUnityPurchasingAppReceipt_m643976844, _iOSStoreBindings_getUnityPurchasingAppReceipt_m4103466157 )
    "_unityPurchasingInterceptPromotionalPurchases", referenced from:
    _OSXStoreBindings_unityPurchasingInterceptPromotionalPurchases_m3411166610 in 51021C4E05B526C3D173876EEAB014CE.o
    _OSXStoreBindings_InterceptPromotionalPurchases_m769580797 in 51021C4E05B526C3D173876EEAB014CE.o
    _iOSStoreBindings_unityPurchasingInterceptPromotionalPurchases_m421098356 in 51021C4E05B526C3D173876EEAB014CE.o
    _iOSStoreBindings_InterceptPromotionalPurchases_m2936449487 in 51021C4E05B526C3D173876EEAB014CE.o
    (maybe you meant: _iOSStoreBindings_unityPurchasingInterceptPromotionalPurchases_m421098356, _OSXStoreBindings_unityPurchasingInterceptPromotionalPurchases_m3411166610 )
    "_unityPurchasingRetrieveProducts", referenced from:
    _iOSStoreBindings_unityPurchasingRetrieveProducts_m1942317051 in 51021C4E05B526C3D173876EEAB014CE.o
    _iOSStoreBindings_RetrieveProducts_m3230380609 in 51021C4E05B526C3D173876EEAB014CE.o
    (maybe you meant: _OSXStoreBindings_unityPurchasingRetrieveProducts_m689081799, _iOSStoreBindings_unityPurchasingRetrieveProducts_m1942317051 )
    "_unityPurchasingPurchase", referenced from:
    _iOSStoreBindings_unityPurchasingPurchase_m127163060 in 51021C4E05B526C3D173876EEAB014CE.o
    _iOSStoreBindings_Purchase_m925077806 in 51021C4E05B526C3D173876EEAB014CE.o
    (maybe you meant: _OSXStoreBindings_unityPurchasingPurchase_m1987719083, _iOSStoreBindings_unityPurchasingPurchase_m127163060 )
    "_unityPurchasingRestoreTransactions", referenced from:
    _iOSStoreBindings_unityPurchasingRestoreTransactions_m2532953743 in 51021C4E05B526C3D173876EEAB014CE.o
    _iOSStoreBindings_RestoreTransactions_m2847613056 in 51021C4E05B526C3D173876EEAB014CE.o
    (maybe you meant: _OSXStoreBindings_unityPurchasingRestoreTransactions_m3672818507, _iOSStoreBindings_unityPurchasingRestoreTransactions_m2532953743 )
    "_setUnityPurchasingCallback", referenced from:
    _iOSStoreBindings_setUnityPurchasingCallback_m1482920455 in 51021C4E05B526C3D173876EEAB014CE.o
    _iOSStoreBindings_SetUnityPurchasingCallback_m756868915 in 51021C4E05B526C3D173876EEAB014CE.o
    (maybe you meant: _OSXStoreBindings_setUnityPurchasingCallback_m3551531614, _iOSStoreBindings_setUnityPurchasingCallback_m1482920455 )
    "_unityPurchasingAddTransactionObserver", referenced from:
    _iOSStoreBindings_unityPurchasingAddTransactionObserver_m463851353 in 51021C4E05B526C3D173876EEAB014CE.o
    _iOSStoreBindings_AddTransactionObserver_m621098447 in 51021C4E05B526C3D173876EEAB014CE.o
    (maybe you meant: _OSXStoreBindings_unityPurchasingAddTransactionObserver_m1174623098, _iOSStoreBindings_unityPurchasingAddTransactionObserver_m463851353 )
    "_unityPurchasingFinishTransaction", referenced from:
    _iOSStoreBindings_unityPurchasingFinishTransaction_m1779103950 in 51021C4E05B526C3D173876EEAB014CE.o
    _iOSStoreBindings_FinishTransaction_m601113037 in 51021C4E05B526C3D173876EEAB014CE.o
    (maybe you meant: _iOSStoreBindings_unityPurchasingFinishTransaction_m1779103950, _OSXStoreBindings_unityPurchasingFinishTransaction_m3734261221 )
    ld: symbol(s) not found for architecture x86_64


    at Unity.IL2CPP.Building.CppProgramBuilder.PostprocessObjectFiles(HashSet`1 objectFiles, CppToolChainContext toolChainContext)
    at Unity.IL2CPP.Building.CppProgramBuilder.Build(IBuildStatistics& statistics)
    at il2cpp.Program.DoRun(String[] args)
    at il2cpp.Program.Run(String[] args)
    at il2cpp.Program.Main(String[] args)
    at Program.Main(String[] args)
     
  4. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,938
    Yes, it does! It looks like something is out of sync with the native libraries in the UnityPurchasing folder. For example, there is managed code in the iOSStoreBindings class, which should not exist for a standalone build on macOS.

    Specifically, this error means that IL2CPP cannot find the native libraries that are used for p/invoke from the managed code. These native libraries need to exist at build time.

    This sounds like a bug with Unity Purchasing, although I'm not familiar enough with that code to be sure. Can you submit a bug report?
     
  5. matt_unity258

    matt_unity258

    Joined:
    Dec 4, 2017
    Posts:
    18
    I submitted a bug report now (Case 1104495).
    Any ideas for a workaround until this gets fixed so that I don't need to manually delete the UnityPurchasing Folder every time I build for StandAlone Mac?
     
  6. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    This is a known issue that we are planning to address in the next release later this year or early 2019.
     
    Dolee-Arts likes this.
  7. matt_unity258

    matt_unity258

    Joined:
    Dec 4, 2017
    Posts:
    18
    Hi @JeffDUnity3D , Any updates on when we can expect this fix to be released?
    Thanks!
     
  8. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    No updates at this time.
     
  9. wagenheimer

    wagenheimer

    Joined:
    Jun 1, 2018
    Posts:
    323
    Mid 2020 and I still not fixed. I'm using UnityPurchasing for MacAppStore.

    When I build and run in Xcode for MAC App Store.
    Using IL2CPP - DllNotFoundException: unitypurchasing Error when initializing it.
    Mono - "_getUnityPurchasingAppReceipt", referenced from)" when Building on XCode

    Is there any workaround for this? How can I manually copy UnityPurchasing to XCode Project to Fix these errors?
     
    matt_unity258 likes this.
  10. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    I don't believe there is a work around, we are still working on this. No ETA yet
     
  11. geretti

    geretti

    Joined:
    Dec 20, 2016
    Posts:
    11
    Same issue here. We temporarily solved it by automating the removal of the Asset/Plugins/UnityPurchasing folder prior to building. We haven't found another work around.
     
  12. GrumpyScott

    GrumpyScott

    Joined:
    Sep 29, 2019
    Posts:
    9
  13. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Thanks, but it appears that this only provides stubs for the missing methods, IAP would not be expected to work if so.
     
  14. GrumpyScott

    GrumpyScott

    Joined:
    Sep 29, 2019
    Posts:
    9
    Decompiling the Apple.dll that is under the UnityPurchasing plugin shows two classes: iOSStoreBindings and OSXStoreBindings

    A sample of the iOSStoreBindings:
    Code (CSharp):
    1.   internal class iOSStoreBindings : INativeAppleStore, INativeStore
    2.   {
    3.     [DllImport("__Internal")]
    4.     private static extern void unityPurchasingRetrieveProducts(string json);
    5.     [DllImport("__Internal")]
    6.     private static extern void unityPurchasingPurchase(string json, string developerPayload);
    7.  
    8.     // ... - removed for post to reduce size
    9.  
    10.     [DllImport("__Internal")]
    11.     private static extern void unityPurchasingContinuePromotionalPurchases();
    12.  
    13.  
    14.     // ... - removed for post to reduce size
    15.  
    16.     public void RetrieveProducts(string json)
    17.     {
    18.       iOSStoreBindings.unityPurchasingRetrieveProducts(json);
    19.     }
    20.     public void Purchase(string productJSON, string developerPayload)
    21.     {
    22.       iOSStoreBindings.unityPurchasingPurchase(productJSON, developerPayload);
    23.     }
    24.  
    25.     // ... - removed for post to reduce size
    26.  
    27.     public void ContinuePromotionalPurchases()
    28.     {
    29.       iOSStoreBindings.unityPurchasingContinuePromotionalPurchases();
    30.     }
    31.   }
    32. }
    33.  
    A sample of the OSXStoreBindings:

    Code (CSharp):
    1.   internal class OSXStoreBindings : INativeAppleStore, INativeStore
    2.   {
    3.     [DllImport("unitypurchasing")]
    4.     private static extern bool unityPurchasingRetrieveProducts(string json);
    5.     [DllImport("unitypurchasing")]
    6.     private static extern bool unityPurchasingPurchase(string json, string developerPayload);
    7.  
    8.     // ... - removed for post to reduce size
    9.  
    10.     [DllImport("unitypurchasing")]
    11.     private static extern void unityPurchasingContinuePromotionalPurchases();
    12.  
    13.     // ... - removed for post to reduce size
    14.  
    15.     public void RetrieveProducts(string json)
    16.     {
    17.       OSXStoreBindings.unityPurchasingRetrieveProducts(json);
    18.     }
    19.     public void Purchase(string productJSON, string developerPayload)
    20.     {
    21.       OSXStoreBindings.unityPurchasingPurchase(productJSON, developerPayload);
    22.     }
    23.  
    24.     // ... - removed for post to reduce size
    25.  
    26.     public void ContinuePromotionalPurchases()
    27.     {
    28.       OSXStoreBindings.unityPurchasingContinuePromotionalPurchases();
    29.     }
    30.   }
    31. }
    32.  
    The iOS bindings expect functions in the program itself for the various unityPurchasing* calls. These are implemented in the UnityPurchasing.m file found in the plugin iOS file that gets included when building for iOS and will be 'in the program'.

    The Mac bindings expect external functions from the UnityPurchasing dll/bundle. These are (assumed to be) implemented in the unitypurchasing.bundle found in the plugin bin folder which gets included when building for Mac (the bundle gets included - not the bin folder).

    The Mac build should use the OSXStoreBindings, the iOS build should use the iOSStoreBindings. So having empty functions for the iOS version when running on Mac should not pose an issue.

    The underlying problem seems to be the Apple.dll containing both the iOS and OSX store bindings so any built application will expect both sets of functions to be defined, even though they will only be using the set specific to the platform they are running on.

    Am I missing something really simple here? Are the Mac versions of the functions not defined in the bundle that gets included with the build?
     
  15. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    @GrumpyScott Got it. I haven't tested your solution, we are still looking into the issue.
     
  16. albert_liebmann

    albert_liebmann

    Joined:
    Aug 14, 2020
    Posts:
    6
    Hi @JeffDUnity3D

    I know this post is already pretty old in the meanwhile, but I was wondering if there will be support for the combination macOS + Il2Cpp backend + Unity purchasing in the near future?

    I was able to have the combination Il2Cpp together with Unity purchasing on three other platforms (Android, Windows Universal Platform and iOS), but on macOS it always ends up with a compilation error in XCode, similar to the one described above.

    Having macOS + Mono backend + Unity purchasing was an option, but also there the adaptation of the UnityPurchasing library manually every time I wanted to publish a new version was annoying and I ended up that Mono was performing too slow on the target devices and this combination also caused some errors on newer Apple M1 processors.

    Temporarily I was removing the Unity Purchasing package dependency and all in app purchase possibilities from the macOS version of my game, but I was still hoping that I could put it back once a fix is available.

    I'm looking forward to an answer from you,
    best regards from Austria,
    Albert Liebmann
     
  17. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Are you seeing an error? I just built to macOS with II2Cpp yesterday with the latest IAP.
     
  18. albert_liebmann

    albert_liebmann

    Joined:
    Aug 14, 2020
    Posts:
    6
    Hi @JeffDUnity3D
    Yes, you are right, I tried this weekend with the latest Unity 2020.3.12, Il2Cpp enabled and the latest Unity In App Purchasing 3.2.2 and it really worked, nice :)
    So I enabled the whole IAP functionality on my macOS version again.
    But I swear that it wasn't working a few weeks or months ago (I forgot the exact time when I last tried it).
    Was there any fix in either IAP or Unity in the last time, which was addressing this problem?
    Thanks anyway,
    Albert
     
  19. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    You would need to tell me what changed in your project or your development environment, I would not know.
     
  20. albert_liebmann

    albert_liebmann

    Joined:
    Aug 14, 2020
    Posts:
    6
    Hi again @JeffDUnity3D

    Unfortunately I cannot recall the exact combination of Unity / Il2Cpp and IAP which I used at that time.

    But I have now the case that I'm getting the following exception on my game, when it's initializing the IAP on a MacBook with an Apple M1 processor:
    DllNotFoundException: Unable to load DLL 'unitypurchasing': The specified module could not be found.

    The IAP library has the version 3.2.2 in this build. I also did the renaming of the ID and the signing of the unitypurchasing.bundle before opening XCode.
    The same app runs on other MacBooks, so it seems to be specific to the M1 processor environment.

    Here is some more metadata of the crash report:
    os = Mac OS X 11.1.0
    sdk_ver = 2020.3.12f1
    scripting_backend = IL2CPP
    device_model = MacBookAir10,1

    Is there any solution to address this problem or did I do anything wrong on building the app?

    Thanks again,
    Albert
     
  21. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Can you test with the Sample IAP Project v2? Unfortunately I don't have an Apple M1 to test with https://forum.unity.com/threads/sample-iap-project.529555/#post-6950270
     
  22. wagenheimer

    wagenheimer

    Joined:
    Jun 1, 2018
    Posts:
    323
    I also have the same problem on a M1.

    Unity 2020.3.13f1
    In-App Purchasing - 3.2.2

    Code (csharp):
    1.  
    2. DllNotFoundException: Unable to load DLL 'unitypurchasing': The specified module could not be found.
    3.   at UnityEngine.Purchasing.OSXStoreBindings.SetUnityPurchasingCallback (UnityEngine.Purchasing.UnityPurchasingCallback AsyncCallback) [0x00000] in <00000000000000000000000000000000>:0
    4.   at UnityEngine.Purchasing.StandardPurchasingModule.InstantiateApple () [0x00000] in <00000000000000000000000000000000>:0
    5.   at UnityEngine.Purchasing.StandardPurchasingModule.InstantiateStore () [0x00000] in <00000000000000000000000000000000>:0
    6.   at UnityEngine.Purchasing.StandardPurchasingModule.Configure () [0x00000] in <00000000000000000000000000000000>:0
    7.   at UnityEngine.Purchasing.PurchasingFactory..ctor (UnityEngine.Purchasing.Extension.IPurchasingModule first, UnityEngine.Purchasing.Extension.IPurchasingModule[] remainingModules) [0x00000] in <00000000000000000000000000000000>:0
    8.   at UnityEngine.Purchasing.ConfigurationBuilder.Instance (UnityEngine.Purchasing.Extension.IPurchasingModule first, UnityEngine.Purchasing.Extension.IPurchasingModule[] rest) [0x00000] in <00000000000000000000000000000000>:0
    9.   at UnityEngine.Purchasing.CodelessIAPStoreListener.InitializePurchasing () [0x00000] in <00000000000000000000000000000000>:0
    10.   at UnityEngine.Purchasing.CodelessIAPStoreListener.get_Instance () [0x00000] in <00000000000000000000000000000000>:0
    11.   at UnityEngine.Purchasing.IAPListener.OnEnable () [0x00000] in <00000000000000000000000000000000>:0
    12.  
    I suspect it's something related do M1 Architecture.

    I generated a new build with only "Intel 64bit" architecture instead of "Intel 64+Apple Silicon" and it worked!

    Captura de Tela 2021-07-07 às 18.41.50.png
     
  23. albert_liebmann

    albert_liebmann

    Joined:
    Aug 14, 2020
    Posts:
    6
    Hi @JeffDUnity3D and @wagenheimer,

    Thanks for the quick replies.

    I unfortunately do not own any M1 based MacBook, where I could try it.
    The crashes I only saw in the 'Crashes and Exceptions' of the Unity Dashboard.

    I will give the hint with setting it to 'Intel 64-bit' without Apple Silicon a try, thanks for that.
    But this then also means, that the game will be not executable anymore on a M1 based Mac, right?

    Have a nice day,
    best regards from Austria,
    Albert
     
  24. wagenheimer

    wagenheimer

    Joined:
    Jun 1, 2018
    Posts:
    323
    It will still work on M1 macs, but through Rosetta instead of natively, which is not exactly a problem because Rosetta works very well to run x86 apps on Mac M1.

    If you want, say the name of your game and I'll test it for you on a Mac M1 as soon as you publish it.
     
  25. albertliebmann

    albertliebmann

    Joined:
    Sep 29, 2020
    Posts:
    8
    Hi @wagenheimer,

    Thanks, that would be great if you can test my game on a Mac M1.
    I published the update yesterday with your suggested Intel 64bit without Apple Silicon setting and it's already available with the version 1.7.5 here:
    https://apps.apple.com/us/app/merge-cubes-and-cards/id1548001142

    Also if you have additional feedback to my game, I would appreciate to read it as well.

    Thanks a lot for your help,
    best regards from Austria,
    Albert
     
  26. wagenheimer

    wagenheimer

    Joined:
    Jun 1, 2018
    Posts:
    323
    I have good and bad news!

    Good - It's working on Mac M1!




    Bad - There is something wrong with the Background. Are you using URP?

    Please let me know if I can help with anything else.

    Best Regards from Brazil
     
  27. albertliebmann

    albertliebmann

    Joined:
    Sep 29, 2020
    Posts:
    8
    OK, the fact that purchasing works with Apple M1 is already good.

    For the other graphical issue with the pink background I honestly don't know why that's shown incorrect on the Mac.
    I'm using URP with a camera which has a viewport of X=-0.1,Y=0,W=1,H=1 and it's filming this crate with the cubes and nothing behind with Depth only and then I have an additional camera behind which films the background (which is just a sprite with a dark scratched metal image) with the full viewport. It seems that the camera for the create/cubes somehow doesn't do 'Depth Only' but draws this pink color behind, because on the last 10% of the horizontal screen it draws this dark scratched metal background properly but on the first 90% (on the viewport of the crate/cubes camera) it doesn't.

    Do you have a clue why this can happen?
    I never saw that issue on Android, Windows and iOS.

    Thanks a lot for testing my game, I appreciate that :)

    Best regards,
    Albert
     
  28. albertliebmann

    albertliebmann

    Joined:
    Sep 29, 2020
    Posts:
    8
    Hi again @wagenheimer,
    I published another MacOS version, where there are no negative values in the main camera viewport anymore. Does this one still have the pink background on your M1 device or did this change fix it?
    Thanks in advance,
    Albert
     
  29. wagenheimer

    wagenheimer

    Joined:
    Jun 1, 2018
    Posts:
    323
    The background is ok now, no more pink background!

    But I don't know why, but the game seems very slow now! It seems to be running at <10fps even using No Lights / Low Quality.

     
  30. albertliebmann

    albertliebmann

    Joined:
    Sep 29, 2020
    Posts:
    8
    OK, interesting that it runs so slow on MacBooks with the M1 processor.

    My MacBook which I'm using for compiling the game is a 10 year old model (I'm usually a windows user, I just didn't want to miss the possibility to publish on macOS and iOS), there I'm expecting that it doesn't run completely fast, but with M1 this shouldn't be the case.

    My next try is now to use the same Quality settings for Mac standalone as I use for mobile devices (Android and iOS), let's see if that brings any improvement.
    It will be version 1.7.7, I hope I will manage the publish process by today...

    Are there some best practices for Graphics/Quality settings for targeting MacBooks somewhere?

    Thanks again for giving it a try and for posting a video,
    Albert
     
  31. albertliebmann

    albertliebmann

    Joined:
    Sep 29, 2020
    Posts:
    8
    Good morning @wagenheimer,

    I just wanted to ask you, if you had already the chance to try the version 1.7.7 of my game with the reduced quality settings on your M1 based MacBook?

    And does anyone in the forum have a suggestion for Graphics/Quality settings, which would lead to run a game like mine smooth on MacBooks?
    Though I'm not sure, if it's a M1 specific problem or if it runs slow on other devices as well.

    Thanks & best regards,
    Albert
     
  32. wagenheimer

    wagenheimer

    Joined:
    Jun 1, 2018
    Posts:
    323
    I just tested, version 1.7.7 is still very slow!.

    I'm not 100% sure, but from what I remember the first version I tested (the one that still had the bug in the background) the speed was normal.
     
  33. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    This does not look to be IAP related at this point, correct?
     
  34. wagenheimer

    wagenheimer

    Joined:
    Jun 1, 2018
    Posts:
    323
    You are right @JeffDUnity3D, sorry, we will continue in the private.

    Regarding the In-App Purchasing issue on Mac with Apple Silicon builds, has this issue been identified? Is there an ongoing solution? Or would I better do a new Bug Report about it?
     
  35. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    I just got an M1 Mac to test with, I was able to build to Mac Standalone w/Silicon without issue. As this thread is originally quite old, please provide steps to reproduce.
     
  36. wagenheimer

    wagenheimer

    Joined:
    Jun 1, 2018
    Posts:
    323
    @JeffDUnity3D I'm able to build it, but when running on the Mac M1 it fails to Initialize UnityPurchasing with the error:

    Code (CSharp):
    1.  
    2. DllNotFoundException: Unable to load DLL 'unitypurchasing': The specified module could not be found.
    3.   at UnityEngine.Purchasing.OSXStoreBindings.SetUnityPurchasingCallback (UnityEngine.Purchasing.UnityPurchasingCallback AsyncCallback) [0x00000] in <00000000000000000000000000000000>:0
    4.   at UnityEngine.Purchasing.StandardPurchasingModule.InstantiateApple () [0x00000] in <00000000000000000000000000000000>:0
    5.   at UnityEngine.Purchasing.StandardPurchasingModule.InstantiateStore () [0x00000] in <00000000000000000000000000000000>:0
    6.   at UnityEngine.Purchasing.StandardPurchasingModule.Configure () [0x00000] in <00000000000000000000000000000000>:0
    7.   at UnityEngine.Purchasing.PurchasingFactory..ctor (UnityEngine.Purchasing.Extension.IPurchasingModule first, UnityEngine.Purchasing.Extension.IPurchasingModule[] remainingModules) [0x00000] in <00000000000000000000000000000000>:0
    8.   at UnityEngine.Purchasing.ConfigurationBuilder.Instance (UnityEngine.Purchasing.Extension.IPurchasingModule first, UnityEngine.Purchasing.Extension.IPurchasingModule[] rest) [0x00000] in <00000000000000000000000000000000>:0
    9.   at UnityEngine.Purchasing.CodelessIAPStoreListener.InitializePurchasing () [0x00000] in <00000000000000000000000000000000>:0
    10.   at UnityEngine.Purchasing.CodelessIAPStoreListener.get_Instance () [0x00000] in <00000000000000000000000000000000>:0
    11.   at UnityEngine.Purchasing.IAPListener.OnEnable () [0x00000] in <00000000000000000000000000000000>:0
    12.  
    Were you able to run your build and complete a purchase?

    Remembering that disabling Apple Silicon when creating the build makes everything works normally.

    If yours worked, please let me know, I'll create a new project here and send a bug report with it and the XCode project so you can test it there.
     
  37. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Got it, a runtime error :) I will test similarly.
     
  38. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    I am able to reproduce on Apple M1, I have let the engineering team know.
     
    albert_liebmann and wagenheimer like this.
  39. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    This is addressed in an upcoming IAP release, hopefully within a few weeks.
     
    wagenheimer and albertliebmann like this.
  40. albert_liebmann

    albert_liebmann

    Joined:
    Aug 14, 2020
    Posts:
    6
    As I stumbled across the new Unity IAP builds, is the release 4.0.0 already addressing the missing unitypurchasing DLL on Apple M1 devices?
     
  41. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    In my testing, yes.
     
    albert_liebmann likes this.
  42. albert_liebmann

    albert_liebmann

    Joined:
    Aug 14, 2020
    Posts:
    6
    Hi @JeffDUnity3D,
    since there is in the meanwhile already version 4.0.3 available from the Unity IAP library, I wanted to ask you what's the time horizon until there is a verified 4.x version ready to take?
    Or is it safe to take the version 4.0.3 for macOS builds already now?
    Thanks,
    Albert
     
  43. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Unfortunately we don't have a timeline for a verified 4.0.3, but I consider it a very stable release.
     
  44. albertliebmann

    albertliebmann

    Joined:
    Sep 29, 2020
    Posts:
    8
    @JeffDUnity3D
    And can I also enable M1 'Apple Silicon' architecture again on my macOS build when updating to version 4.0.3 of the IAP library?
     
  45. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    I have used my M1 Silicon system here without issue! But I believe you are "targeting" M1, correct?
     
  46. albertliebmann

    albertliebmann

    Joined:
    Sep 29, 2020
    Posts:
    8
    Hi @JeffDUnity3D
    Yes, I wanted to target both Intel and M1 Silicon devices with macOS.
    I unfortunately don't have a M1 based system to test with (my MacBook Air is already a few years old), but in case you confirm that the IAP 4.0.3 would work again with Apple M1, I would switch my target architecture to include Apple Silicon again besides to the Intel 64 bit option.
    Thanks in advance,
    Albert
     
  47. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Yep, runtime Unity IAP 4.0.3 looks to function correctly on Mac M1 Silicon.
     
  48. albertliebmann

    albertliebmann

    Joined:
    Sep 29, 2020
    Posts:
    8
    Sounds good, then I will make a release of my game now with IAP 4.0.3 and 'Apple Silicon + Intel 64 bit' as target architecture :)

    Thanks,
    Albert
     
  49. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    You would want to test first, of course.