Conversation
CocoaPods only embeds the frameworks of pods, so a dynamic framework that a Swift package adds through spm_dependency is linked but missing from the app bundle, and the app fails at launch with dyld "Library not loaded". Add them to the embed frameworks script, and remove the pod's duplicate xcframework signature that fails Xcode 26 archives. The new embed_frameworks argument names frameworks that differ from their product (Sentry-Dynamic is Sentry.framework).
cipolleschi
approved these changes
Oct 1, 2026
cipolleschi
left a comment
Contributor
There was a problem hiding this comment.
Thanks for fixing this!
|
@cipolleschi has imported this pull request. If you are a Meta employee, you can view this in D122772893. |
cortinico
approved these changes
Oct 1, 2026
cortinico
left a comment
Contributor
There was a problem hiding this comment.
Review automatically exported from Phabricator review in Meta.
|
@cipolleschi merged this pull request in d787826. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
spm_dependencylinks a pod against Swift package products, but CocoaPods only embeds the frameworks of pods. Dynamic frameworks from Swift packages (binary targets like rive-ios'RiveRuntime, ortype: .dynamicproducts likeAlamofireDynamic) never reach the app bundle, so the app builds but fails at launch withdyld: Library not loaded: @rpath/RiveRuntime.framework/RiveRuntime. Separately, Xcode 26 archives fail on the duplicate signature Xcode writes for a binary target used by a pod:"RiveRuntime.xcframework-ios.signature" couldn't be copied to "Signatures" because an item with the same name already exists.This PR:
install_spm_framework <name>call per framework to the app's[CP] Embed Pods Frameworksscript, which embeds the framework from where Xcode builds it, unless it is static.embed_frameworks:tospm_dependency, defaulting toproducts, for frameworks named differently from their product (Sentry-DynamicisSentry.framework) or coming from the packages a product depends on (MapboxMapsloadsMapboxCommon,MapboxCoreMapsandTurf).*.xcframework-*.signaturefor pods not built into the shared products dir.Libraries work around this on their own today, e.g. react-native-firebase's
firebase_spm.rb, stripe/stripe-react-native#2608, maplibre/maplibre-react-native#1490, or by dropping SPM as in getsentry/sentry-react-native#6381.Changelog:
[IOS] [FIXED] -
spm_dependencyembeds the dynamic frameworks of Swift packages in the app, and takesembed_frameworksfor frameworks named differently from their productTest Plan:
ruby -Itest packages/react-native/scripts/cocoapods/__tests__/spm-test.rbpasses, with 5 new tests. It also fixes the existing tests, whose installer stub lackedaggregate_targetssince #57602.Built https://github.com/mfazekas/rn-spm-dynamic-poc (a library using
AlamofireDynamic,RiveRuntimeandSentry-Dynamic) with thisspm.rbon RN 0.84 and Xcode 26.5:Library not loaded: @rpath/RiveRuntime.framework, and the Release archive fails on the duplicate signature.RiveRuntimeandSentry;AlamofireDynamicdoes not link statically, with or without this change).Its
more-packagesbranch does the same with Agora, Mapbox, Stripe and Firebase.