Running on Apple Vision Pro device crash at launch

The error log:

Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Termination Reason: DYLD 1 Library missing
Library not loaded: @loader_path/libVisionOS-lib.dylib
Referenced from: <59FFC4CD-796F-3BBC-9C7E-04461E821DC8> /Volumes/VOLUME/*/
Reason: tried: '/private/var/containers/Bundle/Application/7159AA7B-96F7-4C28-ADAA-C7E490065721/' (no such file), '/usr/local/lib/libVisionOS-lib.dylib' (no such file), '/usr/lib/libVisionOS-lib.dylib' (no such file, not in dyld cache)
(terminated at launch; ignore backtrace)

Developer environment:

  • Unity 2022.3.18f1
  • XCode 15.2

The setting of Unity:

Does it still have an issue if you disable Symlink Sources and regenerate the Xcode project?

Thank you for your reply. Disabled the Symlink Sources work fine.

1 Like

Can you file a bug with a small repro project and post the bug id here? That way we can get this into our list of things to fix.

I’m having this same issue but Symlink Sources is disabled

Unity 2022.3.19f1
Xcode 15.2
Polyspatial 1.03
visionOS 1.02

Xcode build succeeds but crashes when it tries to run on the device

dyld[909]: Library not loaded: @loader_path/libVisionOS-lib.dylib
  Referenced from: <146B15BB-C71A-3B77-92BF-471BD5345C9B> /private/var/containers/Bundle/Application/F1468BB4-2011-49B6-B34C-63905AA29E0B/
  Reason: tried: '/private/var/containers/Bundle/Application/F1468BB4-2011-49B6-B34C-63905AA29E0B/' (no such file), '/usr/local/lib/libVisionOS-lib.dylib' (no such file), '/usr/lib/libVisionOS-lib.dylib' (no such file, not in dyld cache)
1 Like

Without a sample I’m not sure that I can tell you what the issue might be. Can you put together a small repro sample that demonstrates this?

same here. works fine on simulator but crashes on device

@joejo how can I privately send you a sample project?

If you create a bug through Unity and post the id here (IN-XXXXX) from the sample project I can get it from there.

1 Like

Thanks @joejo! Here it is:


1 Like

Are you building for simulator or for device? And what are you trying to run it on?

Well, the first thing that hit me was that it errored on building because the scene wasn’t selected in the build window. After selecting that, the project built fine in Xcode and ran succesfully in simulator.

yes, it works fine in the simulator. but crashes on the Vision Pro device

Ok now I see. You need to rebuild the Xcode project, this time for the Device SDK and not the Simulator SDK. You can switch that in the Build Window.

Yes, I did that. Sorry if the sample project was not set as Device SDK.

Do you have one Apple Vision Pro with you? Please try to build and run it on the Device and you will see it will crash on startup.

When building as simulator SDK it works fine on simulator.

I am sorry for the late reply. I’ll provide it later.

Dont use Symlilnk Sources in Unity build. and Edit XCode project: Preprocessor.h file at the Classes. Then edit line 178 to line 184.

It’s work for me.

#define UNITY_USES_IAD 0

I did a new Xcode build for Device and it ran just fine. Then I did built over the original Xcode project, changing SDK to Device and doing replacement and that worked as well.

I forgot to mention that the dylib it’s trying to load is only for simulator. On device the library is statically linked in. This tells me that you tried to run a simulator build on device.

Hope that helps.

Interesting - I recall explicitly changing this but maybe my order of things was wrong as I was getting frustrated :thinking: I will try again and let you know what I find. Thank you for the insight!