You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
iOS build fails to link (Undefined symbols: SentryInternalSwizzleApi.Mode.oncePerClass) when consuming the default prebuilt Sentry.xcframework #6465
Use @sentry/react-native 8.19.0 on iOS with the default integration (prebuilt Sentry.xcframework; SENTRY_USE_XCFRAMEWORK unset).
Build the iOS app for a real device (arm64). Ours is an Expo (CNG) app built on EAS Build (JS-1173 image).
The Xcode/ld link step fails (see Actual Result). Setting SENTRY_USE_XCFRAMEWORK=0 (source build) makes it succeed.
Expected Result
The app links against the prebuilt Sentry.xcframework and builds successfully, with no need to fall back to the source-built CocoaPod.
Actual Result
Link step fails:
Undefined symbols for architecture arm64
┌─ Symbol: enum case for Sentry.SentryInternalSwizzleApi.Mode.oncePerClass(Sentry.SentryInternalSwizzleApi.Mode.Type) -> Sentry.SentryInternalSwizzleApi.Mode
└─ Referenced from: function signature specialization <Arg[1] = Dead> of static RNSentry.RNSentryInternal.swizzleRNSScreenViewDidAppear(hook: () -> ()) -> () in RNSentry[28](RNSentryInternal.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Likely cause is the interaction of two changes that landed for 8.18/8.19:
SentryInternalSwizzleApi.Mode.oncePerClass is an internal/@_spi Swift symbol that the prebuilt static Sentry.xcframework slice doesn’t vend, so RNSentry (compiled separately) can’t resolve it at link time. Building sentry-cocoa from source (SENTRY_USE_XCFRAMEWORK=0) keeps both in the same module graph and links cleanly.
Thanks for submitting this, @mikewesthad!
I've already drafted a PR to solve this issue and will continue with it next week: #6468
The valid workaround for now would be to use SENTRY_USE_XCFRAMEWORK=0.
I did an analysis on the prebuilt xcframework to verify if the symbols are really absent, and based on the released artifact, neither the swizzling header nor implementation is simply missing or incorrect.
I downloaded the exact static XCFramework pinned by React Native:
The exact same symbol is defined in the 9.19.1 arm64 framework.
I also compiled a separate Swift consumer against the XCFramework’s private interface and linked it successfully.
This means that the statement that the symbol “is not exported from the XCFramework” might not be accurate for the official 9.19.1 artifact.
The issue is more likely in how the React Native application build integrates the static XCFramework. Possibilities include:
The Sentry static framework is not present in the failing final link command.
The wrong framework slice or an older cached artifact is selected.
A CocoaPods-generated link setting strips or omits the framework in that configuration.
The EAS Xcode/toolchain version changes static Swift linking behavior.
The report shows only the first undefined symbol, while the underlying issue is that the final app target is not linking the relevant Sentry object code.
The Objective-C workaround succeeds because Objective-C class references interact differently with static archive extraction and -ObjC. That does not prove the Swift definitions are absent.
Happy to further investigate this but for that I need the full React Native app link invocation, particularly:
Ld ... arm64
and its complete arguments. Then verify:
-framework Sentry is present.
Which Sentry.framework/Sentry path is selected.
Which architecture slice is used.
Whether -ObjC, -all_load, or -force_load is present.
Whether the selected framework defines the exact mangled symbol.
Ahhh shoot. Sorry! It turns out an internal native dependency had s.dependency 'Sentry', '~> 9.0' in the podspec, so it looks like we were running into a two-Sentry-provider ABI mismatch. SENTRY_USE_XCFRAMEWORK=0 was letting us compile against the same source module and bypass the mismatch
Activity
linear-code commentedon Jul 16, 2026
RN-712
alwx commentedon Jul 17, 2026
Thanks for submitting this, @mikewesthad!
I've already drafted a PR to solve this issue and will continue with it next week: #6468
The valid workaround for now would be to use
SENTRY_USE_XCFRAMEWORK=0.mikewesthad commentedon Jul 17, 2026
Thanks! Yeah that's what we ended up using
fix(ios): Restore ObjC SentrySwizzle for RNSScreen to link against xc…
philprime commentedon Jul 20, 2026
I did an analysis on the prebuilt xcframework to verify if the symbols are really absent, and based on the released artifact, neither the swizzling header nor implementation is simply missing or incorrect.
I downloaded the exact static XCFramework pinned by React Native:
That checksum matches
sentry-react-native/packages/core/scripts/sentry_utils.rb.The device framework contains:
PrivateHeaders/SentrySwizzle.hSentrySwizzle.oSentrySwizzleWrapperHelper.oSentryInternalSwizzleApi.oarm64-apple-ios.private.swiftinterfaceThe static binary defines all relevant symbols:
The exact mangled symbol required by a separate Swift consumer is:
The exact same symbol is defined in the 9.19.1 arm64 framework.
I also compiled a separate Swift consumer against the XCFramework’s private interface and linked it successfully.
This means that the statement that the symbol “is not exported from the XCFramework” might not be accurate for the official 9.19.1 artifact.
The issue is more likely in how the React Native application build integrates the static XCFramework. Possibilities include:
The Objective-C workaround succeeds because Objective-C class references interact differently with static archive extraction and
-ObjC. That does not prove the Swift definitions are absent.Happy to further investigate this but for that I need the full React Native app link invocation, particularly:
and its complete arguments. Then verify:
-framework Sentryis present.Sentry.framework/Sentrypath is selected.-ObjC,-all_load, or-force_loadis present.mikewesthad commentedon Jul 20, 2026
Ahhh shoot. Sorry! It turns out an internal native dependency had
s.dependency 'Sentry', '~> 9.0'in the podspec, so it looks like we were running into a two-Sentry-provider ABI mismatch.SENTRY_USE_XCFRAMEWORK=0was letting us compile against the same source module and bypass the mismatchphilprime commentedon Jul 21, 2026
No worries! Happy to read that you were able to find the root cause.