Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Bug Unity 2022.3.21f1 Project not building in Xcode: libhostfxr.dylib failed to load

Discussion in 'iOS and tvOS' started by Toastbyte, Mar 9, 2024.

  1. Toastbyte

    Toastbyte

    Joined:
    Sep 1, 2016
    Posts:
    55
    Hi everyone,

    So I'm trying to submit my unity-made app to App Store Connect through Xcode. But I have been having this problem for a while now and nothing seems to fix it. I also couldn't find any helpful solutions online and don't know what to do.

    (I'm using MacOS Sonoma 14.2 and XCode version 15.1 (15C65))

    When I build my app in XCode, it says the following error. I have tried everything from updating to the newest .Net from the link listed to giving the project folder permissions by doing chmod. But either I'm doing something completely wrong, or there is a problem/bug that I am not aware of.


    error: Sandbox: chmod(4319) deny(1) file-write-mode /Users/XXX/Desktop/1.0.4_20/Il2CppOutputProject/IL2CPP/build/deploy_x86_64/il2cpp (in target 'GameAssembly' from project 'Unity-iPhone')
    error: Sandbox: chmod(4320) deny(1) file-write-mode /Users/XXX/Desktop/1.0.4_20/Il2CppOutputProject/IL2CPP/build/deploy_x86_64/bee_backend/mac-x64/bee_backend (in target 'GameAssembly' from project 'Unity-iPhone')
    error: Sandbox: il2cpp(4321) deny(1) file-read-data /Users/XXX/Desktop/1.0.4_20/Il2CppOutputProject/IL2CPP/build/deploy_x86_64/libhostfxr.dylib (in target 'GameAssembly' from project 'Unity-iPhone')
    error: 2 duplicate reports for Sandbox: il2cpp(4321) deny(1) file-read-data /Users/XXX/Desktop/1.0.4_20/Il2CppOutputProject/IL2CPP/build/deploy_x86_64/libhostfxr.dylib (in target 'GameAssembly' from project 'Unity-iPhone')
    error: Sandbox: il2cpp(4321) deny(1) file-read-data /Users/XXX/Desktop/1.0.4_20/Il2CppOutputProject/IL2CPP/build/deploy_x86_64 (in target 'GameAssembly' from project 'Unity-iPhone')
    chmod: Unable to change file mode on /Users/XXX/Desktop/1.0.4_20/Il2CppOutputProject/IL2CPP/build/deploy_x86_64/il2cpp: Operation not permitted
    chmod: Unable to change file mode on /Users/XXX/Desktop/1.0.4_20/Il2CppOutputProject/IL2CPP/build/deploy_x86_64/bee_backend/mac-x64/bee_backend: Operation not permitted
    Failed to load /Users/XXX/Desktop/1.0.4_20/Il2CppOutputProject/IL2CPP/build/deploy_x86_64/libhostfxr.dylib, error: dlopen(/Users/XXX/Desktop/1.0.4_20/Il2CppOutputProject/IL2CPP/build/deploy_x86_64/libhostfxr.dylib, 0x0001): tried: '/Users/XXX/Desktop/1.0.4_20/Il2CppOutputProject/IL2CPP/build/deploy_x86_64/libhostfxr.dylib' (file system sandbox blocked open()), '/System/Volumes/Preboot/Cryptexes/OS/Users/XXX/Desktop/1.0.4_20/Il2CppOutputProject/IL2CPP/build/deploy_x86_64/libhostfxr.dylib' (no such file), '/Users/XXX/Desktop/1.0.4_20/Il2CppOutputProject/IL2CPP/build/deploy_x86_64/libhostfxr.dylib' (file system sandbox blocked open())
    The library libhostfxr.dylib was found, but loading it from /Users/XXX/Desktop/1.0.4_20/Il2CppOutputProject/IL2CPP/build/deploy_x86_64/libhostfxr.dylib failed
    - Installing .NET prerequisites might help resolve this problem.
    https://go.microsoft.com/fwlink/?linkid=2063366

    Any help is much appreciated! Thank you in advance