Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question can't build via xcode ( m2, dotnet7.0, unity 2022.3 )

Discussion in 'macOS' started by leimiles, Sep 22, 2023.

  1. leimiles

    leimiles

    Joined:
    Oct 30, 2018
    Posts:
    4
    got these messages, any help, please..

    error: 2 duplicate reports for Sandbox: il2cpp(2304) deny(1) file-read-data /Users/zhulei/Projects/temp/Build/Il2CppOutputProject/IL2CPP/build/deploy_arm64/libhostfxr.dylib (in target 'GameAssembly' from project 'Unity-iPhone')

    Failed to load /Users/zhulei/Projects/temp/Build/Il2CppOutputProject/IL2CPP/build/deploy_arm64/libhostfxr.dylib, error: dlopen(/Users/zhulei/Projects/temp/Build/Il2CppOutputProject/IL2CPP/build/deploy_arm64/libhostfxr.dylib, 0x0001): tried: '/Users/zhulei/Projects/temp/Build/Il2CppOutputProject/IL2CPP/build/deploy_arm64/libhostfxr.dylib' (file system sandbox blocked open()), '/System/Volumes/Preboot/Cryptexes/OS/Users/zhulei/Projects/temp/Build/Il2CppOutputProject/IL2CPP/build/deploy_arm64/libhostfxr.dylib' (no such file), '/Users/zhulei/Projects/temp/Build/Il2CppOutputProject/IL2CPP/build/deploy_arm64/libhostfxr.dylib' (file system sandbox blocked open())

    The library libhostfxr.dylib was found, but loading it from /Users/zhulei/Projects/temp/Build/Il2CppOutputProject/IL2CPP/build/deploy_arm64/libhostfxr.dylib failed

    - Installing .NET prerequisites might help resolve this problem.

    https://go.microsoft.com/fwlink/?linkid=2063366
     
  2. Logg-Out

    Logg-Out

    Joined:
    Jun 27, 2017
    Posts:
    4
    Same problem here.
    I initially had the "Command PhaseScriptExecution failed with a nonzero exit code" error, so I updated the Editor to 2022.3.10 as it was said to fix the issue, but now I get the "2 duplicate reports for Sandbox" error instead.
    I tried in both development and production modes, but nothing changes.
    Also, XCode doesn't give me any logs past the error name, so that doesn't help... Not sure if it's a bug with its new version or what, because that never happened before.
     
  3. marcusdyrholm

    marcusdyrholm

    Joined:
    Mar 18, 2021
    Posts:
    11
    I am having the same issues, Unity 2022.3.6 is what I'm using.
     
  4. Rountman

    Rountman

    Joined:
    Jan 24, 2021
    Posts:
    4
    At first I had an error "Command PhaseScriptExecution failed with a nonzero exit code" and after recommended xcode settings i have "Sandbox: il2cpp(19313) deny(1) file-read-data /Users/../work/Unity/ARPictureHunter/Build/Il2CppOutputProject/IL2CPP/build/deploy_arm64/libhostfxr.dylib".

    After updating iOS from mac it stopped working for me
     
    Last edited: Oct 2, 2023
  5. Rountman

    Rountman

    Joined:
    Jan 24, 2021
    Posts:
    4
    Now I tried to download the new alpha version(2023.3.0a7) of unity for apple silicon and it works for me
     
    Last edited: Oct 2, 2023
  6. Logg-Out

    Logg-Out

    Joined:
    Jun 27, 2017
    Posts:
    4
    I tried updating to the latest alpha version (2023.3.0a8), and now I get "Undefined symbols:" and "Linker command failed with exit code 1 (use -v to see invocation)" instead.

    I still don't have any actual logs from XCode, which really doesn't help identify where the problem comes from. (I love how there's nothing after "Undefined symbol:"'s colon.) No idea how to fix THAT fun little hiccup, either. I can't find anything about it online. I guess that's an XCode 15 issue, not a Unity one, but it just makes things even more complicated.

    I've been trying to update my app for 2 weeks now, and everytime I think I've found the solution, I just get a new error... ;-;
     
    pandolfini likes this.
  7. Logg-Out

    Logg-Out

    Joined:
    Jun 27, 2017
    Posts:
    4
    I finally got something out of the XCode logs! By attempting to build unity-framework instead of unity-iphone, I actually got details on the errors:

    ld: warning: ignoring duplicate libraries: '-lc++'

    ld: Undefined symbols:

    _FIRAuthErrorUserInfoUpdatedCredentialKey, referenced from:

    firebase::auth::SignInResultCallback(FIRAuthDataResult\*, NSError\*, firebase::SafeFutureHandle<firebase::auth::SignInResult>, firebase::auth::AuthData*) in libFirebaseCppAuth.a[arm64][6](auth_ios.mm.o)

    firebase::auth::SignInResultCallback(FIRAuthDataResult\*, NSError\*, firebase::SafeFutureHandle<firebase::auth::SignInResult>, firebase::auth::AuthData*) in libFirebaseCppAuth.a[arm64][6](auth_ios.mm.o)
    _OBJC_CLASS_$_FIRAuth, referenced from:

    in libFirebaseCppAuth.a[arm64][6](auth_ios.mm.o)
    _OBJC_CLASS_$_FIRDatabase, referenced from:

    in libFirebaseCppDatabase.a[arm64][12](database_ios.mm.o)
    _OBJC_CLASS_$_FIRDatabaseReference, referenced from:

    in libFirebaseCppDatabase.a[arm64][13](database\_reference\_ios.mm.o)
    _OBJC_CLASS_$_FIREmailAuthProvider, referenced from:

    in libFirebaseCppAuth.a[arm64][7](credential_ios.mm.o)
    _OBJC_CLASS_$_FIRFacebookAuthProvider, referenced from:

    in libFirebaseCppAuth.a[arm64][7](credential_ios.mm.o)
    _OBJC_CLASS_$_FIRGameCenterAuthProvider, referenced from:

    in libFirebaseCppAuth.a[arm64][7](credential_ios.mm.o)
    _OBJC_CLASS_$_FIRGitHubAuthProvider, referenced from:

    in libFirebaseCppAuth.a[arm64][7](credential_ios.mm.o)
    _OBJC_CLASS_$_FIRGoogleAuthProvider, referenced from:

    in libFirebaseCppAuth.a[arm64][7](credential_ios.mm.o)
    _OBJC_CLASS_$_FIROAuthProvider, referenced from:

    in libFirebaseCppAuth.a[arm64][7](credential_ios.mm.o)
    _OBJC_CLASS_$_FIRPhoneAuthCredential, referenced from:

    in libFirebaseCppAuth.a[arm64][8](user_ios.mm.o)
    _OBJC_CLASS_$_FIRPhoneAuthProvider, referenced from:

    in libFirebaseCppAuth.a[arm64][7](credential_ios.mm.o)
    _OBJC_CLASS_$_FIRTransactionResult, referenced from:

    in libFirebaseCppDatabase.a[arm64][13](database\_reference\_ios.mm.o)
    _OBJC_CLASS_$_FIRTwitterAuthProvider, referenced from:

    in libFirebaseCppAuth.a[arm64][7](credential_ios.mm.o)
    clang: error: linker command failed with exit code 1 (use -v to see invocation)


    So it looks like the Firebase library is what's causing the errors for me. I already had an issue with it recently where the Android version of my app broke out of nowhere because of Firebase, and I had needed to re-add it to my project from scratch.
    That was back in August, and I made updates for both Android and iOS since then without issues. But now, there's once again a problem with Firebase.
    I assume it's due to the XCode update and new iOS version not being supported. I tried updating Firebase to its latest version, but that didn't change anything, either: I still get the same errors, and my build still fails...

    Sooo, now at least I know WHAT's causing the problem, but still no clue on HOW to fix it, other that just blindly hoping for a fix from Google. :D
     
    pandolfini likes this.
  8. Logg-Out

    Logg-Out

    Joined:
    Jun 27, 2017
    Posts:
    4
    I finally fixed it! In a really dumb way!
    The only Firebase libs I was using were Firestore and Cloud Functions (and their dependencies, of course). But, after noticing that a bunch of the errors included Auth, I added the Firebase Authentification package to my project, and lo and behold, some of the errors vanished... So I just kept adding more of the Firebase packages and eventually, the build worked.
    I'll reiterate that none of those libraries i added are used in my app in any way. And it used to work without them. But now, I have to include a whole bunch of useless packages just so the ones I actually do need work... This is so weird.

    But at least I finally got an iOS update out! Yipee! Now Android is the one that doesn't work anymore, seemingly because, of course, of the Firebase packages I added... Oh well, that's the life of a dev, I suppose.
     
  9. pandolfini

    pandolfini

    Joined:
    Feb 5, 2020
    Posts:
    17
    I seem to be having the same issue, but with AdMob. Which packages did you have to add, @Logg-Out ?
     
    metinb16 likes this.
  10. metinb16

    metinb16

    Joined:
    Sep 22, 2022
    Posts:
    3
    @pandolfini hi i have same issue do u find solution
     
    jason_unity999 likes this.
  11. Scorpion_1980

    Scorpion_1980

    Joined:
    Jun 21, 2016
    Posts:
    23
    Errors still prevent me from making a build on Xcode 15 (unity 2022.3.19f). And Xcode 14 no longer publishes on iOS. Need help!!!
     

    Attached Files:

    jason_unity999 likes this.