Search Issue Tracker

Third Party Issue

Votes

3

Found in

2019.4

2020.3

2021.1

2021.2

2021.2.0a13

Issue ID

1329291

Regression

Yes

[M1] [iOS] build fails in Xcode when launching from M1 Silicon Mac "file system sandbox blocked", "error loading dlopen"

MacOS

-

Reproduction steps:
1. Create a new project
2. Build for iOS
3. Open the project generated in Xcode
4. Deploy to "My Mac (Designed for iPad)" target in Xcode
5. Wait for the build to succeed

Expected result: the application launches
Actual result: the application fails to launch with errors: "file system sandbox blocked", "error loading <file path>: dlopen"

Workaround: After step 3, select Unity-iPhone, go Build phases, Link binary with libraries and add UnityFramework.framework to the list

Tested with:
Mac mini (M1, 2020) 8GB, OSX 11.2.1
Mac mini (M1, 2020) 16GB, OSX 11.2.3

Reproducible with: 2019.4.0f1, 2019.4.24f1, 2020.3.5f1, 2021.1.4f1, 2021.2.0a13
Not reproducible with 2018.4.34f1

Not reproducible with standalone Mac builds using Xcode

  1. Resolution Note (2021.2.X):

    This is a bug in macOS Sandbox, bug report was sent to Apple. There are two options to workaround this issue:

    1. Link binary with UnityFramework
    1.1. Build iOS app and open Xcode project.
    1.2. In Project navigator select project file
    1.3. Select 'Unity-iPhone' target
    1.4. Go to 'Build Phases' tab
    1.5. In 'Link Binary With Libraries' section click plus icon and 'UnityFramework.framework'
    1.6. Build and run. It should work like expected now.

    2. Build specifically for M1
    2.1. In Unity Editor open Build Settings
    2.2. In platform list select 'Windows, Mac, Linux' and click 'Switch Platform' button at the bottom right
    2.3. For 'Target Platform' select 'macOS'
    2.4. For 'Architecture' select 'Apple Silicon' or 'Intel 64-bit + Apple Silicon'
    2.5. (Optional) Enable 'Create Xcode Project'
    2.6. Build.

Comments (2)

  1. kylekaturn

    Apr 18, 2021 09:36

    To KILES
    It has nothing to do with Simulator SDK.
    New M1 mac can run iOS app (built with iOS SDK) natively.
    And xcode with M1 mac can do also.
    This is some kind of bug of Unity. And most importantly , 2018.4.34 doesnt have this problem.

  2. kiles

    Apr 17, 2021 18:42

    Have you selected "Simulator SDK" in the player settings?

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.