Unable to build an Xcode project for visionOS

I’m working on a project targeting Apple visionOS. I was able to build it in Unity 2022.x but I’m getting the following error when trying to build an Xcode project generated by Unity 6000.x:

Users/.../Libraries/com.unity.xr.visionos/Runtime/Plugins/visionos/SwiftTrampoline/UnityLibrary.swift:39:63 Cannot find 'MH_EXECUTE_SYM' in scope

See also the screenshot:

The Unity version I’m using is 6000.0.19f1 (but I’ve also tried previous versions of 6000.x with no luck.

Here are the versions of packages that I think might be relevant:

"com.unity.inputsystem": "1.10.0",
"com.unity.xr.hands": "1.4.3",
"com.unity.xr.interaction.toolkit": "3.0.5",
"com.unity.xr.management": "4.5.0",
"com.unity.xr.meta-openxr": "2.0.1",
"com.unity.xr.openxr": "1.12.1",
"com.unity.xr.visionos": "1.3.9",
"com.unity.modules.xr": "1.0.0",

EDIT: I’ve tried downgrading the com.unity.xr.vision package from 1.3.9 to 1.3.1 and the build succeeds. So this change in UnityLibrary.swift seems to be the culprit:

Please advise.

Have you tried upgrading to 2.0.0-pre.11? That’s the version we would recommend for Unity 6000.

1 Like

Thanks, I’ll give it a try!

1 Like

This resolved the issue but now I have another one. I’ve created another post for it. I’d appreaciate if you could take a look: ARM64 branch out of range when building for visionOS