Skip to content

fix(react-native): Skip CocoaPods steps for Swift Package Manager projects - #1386

Merged
alwx merged 2 commits into
masterfrom
alwx/bugfix/rn-swiftpm-skip-pods
Nov 11, 2026
Merged

alwx merged 2 commits into
masterfrom
alwx/bugfix/rn-swiftpm-skip-pods

Conversation

@alwx

@alwx alwx commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

React Native 0.87+ can link iOS dependencies through Swift Package Manager (SwiftPM) instead of CocoaPods. react-native spm add --deintegrate keeps the Podfile but removes the React Native lines from it, so the file is no longer valid Ruby. The wizard still added use_modular_headers! to this file and offered to run pod install, which failed.

The wizard now looks for the build/generated/autolinking package that React Native adds to the Xcode project. If it finds the package, it does not change the Podfile and does not offer pod install. The bundle phase and the debug files upload phase are patched as before.

I tested this on the React Native 0.88.1 template after I applied React Native's own SwiftPM injection to it. The wizard found SwiftPM, kept all SwiftPM package references in project.pbxproj, and patched both build phases. Unit tests cover the detection.

alwx and others added 2 commits November 11, 2026 13:52
…jects

`react-native spm add --deintegrate` keeps a Podfile that `pod install`
cannot parse. The wizard found this Podfile, added
`use_modular_headers!` to it, and offered to run `pod install`, which
failed. The wizard now finds the SwiftPM autolinking package in the
Xcode project and skips these steps.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Replace the #XXXX placeholder with the number of the pull request that adds the entry.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@alwx
alwx requested a review from antonis November 11, 2026 13:00
@alwx
alwx marked this pull request as ready for review November 11, 2026 13:00

@antonis antonis left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🙇

@alwx
alwx merged commit b262ed0 into master Nov 11, 2026
59 checks passed
@alwx
alwx deleted the alwx/bugfix/rn-swiftpm-skip-pods branch November 11, 2026 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants