sentry-unity
sentry-unity copied to clipboard
iOS app crash due to `dyld[1746]: Library not loaded: '@rpath/Sentry.framework/Sentry' `
Environment
iOS 15.7 XCode 13.4.1 macOS Monterey 12.5.1
How do you use Sentry? Sentry SaaS (sentry.io)
Which version of the SDK? 0.23.0
How did you install the package? (Git-URL, Assetstore) Git-URL via UPM
Which version of Unity? Unity 2021.3.6f1
Is this happening in Unity (editor) or on a player like Android, iOS, Windows? iOS
Steps to Reproduce
-
Install Sentry to Unity project via UPM
-
Set up Sentry via Wizard
-
Build Unity project targeting iOS platform
-
XCode build is sucessful
-
App crashes on immediately boot
Expected Result
App should not crash immediately on boot
Actual Result
App crashes immediately after successful build:
dyld`__abort_with_payload:
0x101948b0c <+0>: mov x16, #0x209
0x101948b10 <+4>: svc #0x80
-> 0x101948b14 <+8>: b.lo 0x101948b34 ; <+40>
0x101948b18 <+12>: pacibsp
0x101948b1c <+16>: stp x29, x30, [sp, #-0x10]!
0x101948b20 <+20>: mov x29, sp
0x101948b24 <+24>: bl 0x101909f64 ; cerror_nocancel
0x101948b28 <+28>: mov sp, x29
0x101948b2c <+32>: ldp x29, x30, [sp], #0x10
0x101948b30 <+36>: retab
0x101948b34 <+40>: ret
dyld[1746]: Library not loaded: '@rpath/Sentry.framework/Sentry'
Referenced from: '/private/var/containers/Bundle/Application/CDCAFA71-2AB9-4BA7-82FA-499E19B0D326/My.app/Frameworks/UnityFramework.framework/UnityFramework'
Reason: tried: '/usr/lib/swift/Sentry.framework/Sentry' (no such file), '/private/var/containers/Bundle/Application/CDCAFA71-2AB9-4BA7-82FA-499E19B0D326/My.app/Frameworks/Sentry.framework/Sentry' (no such file), '/private/var/containers/Bundle/Application/CDCAFA71-2AB9-4BA7-82FA-499E19B0D326/My.app/Frameworks/UnityFramework.framework/Frameworks/Sentry.framework/Sentry' (no such file), '/private/var/containers/Bundle/Application/CDCAFA71-2AB9-4BA7-82FA-499E19B0D326/My.app/Frameworks/Sentry.framework/Sentry' (no such file), '/private/var/containers/Bundle/Application/CDCAFA71-2AB9-4BA7-82FA-499E19B0D326/My.app/Frameworks/Sentry.framework/Sentry' (no such file), '/System/Library/Frameworks/Sentry.framework/Sentry' (no such file)
Library not loaded: '@rpath/Sentry.framework/Sentry'
Referenced from: '/private/var/containers/Bundle/Application/CDCAFA71-2AB9-4BA7-82FA-499E19B0D326/My.app/Frameworks/UnityFramework.framework/UnityFramework'
Reason: tried: '/usr/lib/swift/Sentry.framework/Sentry' (no such file), '/private/var/containers/Bundle/Application/CDCAFA71-2AB9-4BA7-82FA-499E19B0D326/My.app/Frameworks/Sentry.framework/Sentry' (no such file), '/private/var/containers/Bundle/Application/CDCAFA71-2AB9-4BA7-82FA-499E19B0D326/My.app/Frameworks/UnityFramework.framework/Frameworks/Sentry.framework/Sentry' (no such file), '/private/var/containers/Bundle/Application/CDCAFA71-2AB9-4BA7-82FA-499E19B0D326/My.app/Frameworks/Sentry.framework/Sentry' (no such file), '/private/var/containers/Bundle/Application/CDCAFA71-2AB9-4BA7-82FA-499E19B0D326/My.app/Frameworks/Sentry.framework/Sentry' (no such file), '/System/Library/Frameworks/Sentry.framework/Sentry' (no such file)
(lldb)
Any logs or screenshots






I've tried with Native iOS enabled and disabled
Thanks for raising. Any logs in the Unity Console by any chance, of Sentry failing to do its thing?
Could you please attach a repro? The xcode project it generates would help. It seems like the Sentry native (cocoa) SDK isn't getting added to the final xcode project, somehow. But yet, it's compiling, and we refer to it from main.m
.
In CI we build an app from Unity 2021.3 and launch on an emulator, and capture events. So we'd need a repro to see how your app is behaving different than the app we build in CI.
Btw, did you upgrade between SDK versions? Or is that a fresh install of Sentry's SDK?
Hi, I toggled Embed & Sign
on Sentry.framework inside the UnityFramework and I'm getting some signing related error:

Here is what I'm getting from XCode:
dyld[1873]: Library not loaded: '@rpath/Sentry.framework/Sentry'
Referenced from: '/private/var/containers/Bundle/Application/5F5C595D-139F-4791-B039-FFB7F9DE4CE8/My.app/Frameworks/UnityFramework.framework/UnityFramework'
Reason: tried: '/usr/lib/swift/Sentry.framework/Sentry' (no such file), '/private/var/containers/Bundle/Application/5F5C595D-139F-4791-B039-FFB7F9DE4CE8/My.app/Frameworks/Sentry.framework/Sentry' (no such file), '/private/var/containers/Bundle/Application/5F5C595D-139F-4791-B039-FFB7F9DE4CE8/My.app/Frameworks/UnityFramework.framework/Frameworks/Sentry.framework/Sentry' (code signature in <2A413EDD-AA30-30A7-A238-EACDC253CDF0> '/private/var/containers/Bundle/Application/5F5C595D-139F-4791-B039-FFB7F9DE4CE8/My.app/Frameworks/UnityFramework.framework/Frameworks/Sentry.framework/Sentry' not valid for use in process: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.), '/private/var/containers/Bundle/Application/5F5C595D-139F-4791-B039-FFB7F9DE4CE8/My.app/Frameworks/Sentry.framework/Sentry' (no such file), '/private/var/containers/Bundle/Application/5F5C595D-139F-4791-B039-FFB7F9DE4CE8/My.app/Frameworks/Sentry.framework/Sentry' (no such file), '/System/Library/Frameworks/Sentry.framework/Sentry' (no such file)
Library not loaded: '@rpath/Sentry.framework/Sentry'
Referenced from: '/private/var/containers/Bundle/Application/5F5C595D-139F-4791-B039-FFB7F9DE4CE8/My.app/Frameworks/UnityFramework.framework/UnityFramework'
Reason: tried: '/usr/lib/swift/Sentry.framework/Sentry' (no such file), '/private/var/containers/Bundle/Application/5F5C595D-139F-4791-B039-FFB7F9DE4CE8/My.app/Frameworks/Sentry.framework/Sentry' (no such file), '/private/var/containers/Bundle/Application/5F5C595D-139F-4791-B039-FFB7F9DE4CE8/My.app/Frameworks/UnityFramework.framework/Frameworks/Sentry.framework/Sentry' (code signature in <2A413EDD-AA30-30A7-A238-EACDC253CDF0> '/private/var/containers/Bundle/Application/5F5C595D-139F-4791-B039-FFB7F9DE4CE8/My.app/Frameworks/UnityFramework.framework/Frameworks/Sentry.framework/Sentry' not valid for use in process: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.), '/private/var/containers/Bundle/Application/5F5C595D-139F-4791-B039-FFB7F9DE4CE8/My.a
(lldb)
In particular: entry.framework/Sentry' not valid for use in process: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.)
I tried add hoc signing with codesign
but getting the same results ...
Any logs in the Unity Console by any chance, of Sentry failing to do its thing?
I didn't see any ... Unity build was successful ..
Could you please attach a repro?
I'll try to find some time and attach a repro ...
Sentry native (cocoa) SDK
I have sentry native SDK installed separately on a non-Unity iOS target
In CI we build an app from Unity 2021.3 and launch on an emulator
I am on an m1 mac book so I cannot use an emulator. Since Unity does not have support for arm64 simulator SDKs right now.
Btw, did you upgrade between SDK versions? Or is that a fresh install of Sentry's SDK?
Fresh install of Sentry's Unity SDK
In particular: entry.framework/Sentry' not valid for use in process: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.)
Not to say it's a solution, but a work around, to unblock you, could be to use Disable Library Validation
as pointed out in this thread:
https://github.com/opencv/opencv/issues/15645#issuecomment-554495051
Thanks for all the other info. The repro could help further.
Hi @michaelhly. Did the workaround work for you? A repro would be highly appreciated!
Same thing happen to me
I have sentry native SDK installed separately on a non-Unity iOS target
Do I read that correctly: You're embedding the Unity game within another App?
I have sentry native SDK installed separately on a non-Unity iOS target
Do I read that correctly: You're embedding the Unity game within another App?
We're using Unity as a library
We're using Unity as a library
The SDK does not really support this use case. There might be a workaround by disabling the Native SDKs and simply relying on the .NET layer to avoid conflicts.
I wonder if installing the Sentry Cocoa SDK separately in the main application would work in this scenario? I mean, it would work for the app, but would Sentry-Unity find it and use it for the library components?
would Sentry-Unity find it and use it for the library components
It does not due to the way is it set up right now.
- The Unity SDK propagates all the relevant options to the native layer at build time (e.g. DNS, release, environment, debug).
- Based on that it does not try to interact with the native layer if the native support has been disabled at build time (e.g. no scope sync)
It would be really nice to have tho.
@bitsandfoxes it's something that we really to have, but for now it's preventing us from purchasing license
We're going to follow up on this in: https://github.com/getsentry/sentry-unity/issues/1009 Getting it to work at the very least with native support disabled is definitely something we're interested in.