Repository navigation
iOS build fails to link (Undefined symbols: SentryInternalSwizzleApi.Mode.oncePerClass) when consuming the default prebuilt Sentry.xcframework #6465
Description
Activity
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 useSENTRY_USE_XCFRAMEWORK=0.- moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 3
on Jul 17, 2026 Thanks! Yeah that's what we ended up using
- added a commit that references this issue
on 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:
Sentry.xcframework.zip 9.19.1 SHA-256: d6d545af17e49851cda2747b0f45cde78ce08ea37709dde5a956c6b4671224e8That checksum matches
sentry-react-native/packages/core/scripts/sentry_utils.rb.
The device framework contains:PrivateHeaders/SentrySwizzle.hSentrySwizzle.oSentrySwizzleWrapperHelper.oSentryInternalSwizzleApi.oarm64-apple-ios.private.swiftinterface
The static binary defines all relevant symbols:
SentryInternalSwizzleApi.instanceMethod(...) SentryInternalSwizzleApi.Mode.oncePerClass _OBJC_CLASS_$_SentrySwizzle _OBJC_CLASS_$_SentrySwizzleWrapperHelperThe exact mangled symbol required by a separate Swift consumer is:
_$s6Sentry0A18InternalSwizzleApiV4ModeO12oncePerClassyA2EmFWCThe 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 ... arm64and its complete arguments. Then verify:
-framework Sentryis present.- Which
Sentry.framework/Sentrypath is selected. - Which architecture slice is used.
- Whether
-ObjC,-all_load, or-force_loadis present. - Whether the selected framework defines the exact mangled symbol.
- moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 3
on 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 mismatchNo worries! Happy to read that you were able to find the root cause.
Metadata
Metadata
Assignees
Labels
Projects
- StatusShow more project fieldsNo status
What React Native libraries do you use?
Expo Application Services (EAS), Expo (mobile only), Hermes
Are you using sentry.io or on-premise?
sentry.io (SaS)
Are you using any other error monitoring solution alongside Sentry?
Yes
Other Error Monitoring Solution Name
No response
@sentry/react-native SDK Version
8.19.0
How does your development environment look like?
Sentry.init()
Steps to Reproduce
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:
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.