Skip to content

fix: duplicate symbols for ReactBrownfield#296

Merged
hurali97 merged 2 commits intomainfrom
feat/fix-duplicate-symbols-rnb
Apr 10, 2026
Merged

fix: duplicate symbols for ReactBrownfield#296
hurali97 merged 2 commits intomainfrom
feat/fix-duplicate-symbols-rnb

Conversation

@hurali97
Copy link
Copy Markdown
Member

@hurali97 hurali97 commented Apr 9, 2026

Summary

Fixes - callstackincubator/rock#636

Problem
Consumer apps link BrownfieldLib (which, via CocoaPods / inherit! :complete, already includes ReactBrownfield in the same framework binary) and ship ReactBrownfield.xcframework for import ReactBrownfield and Xcode integration. That loads two copies of the same Swift/ObjC types into the process, which surfaces as duplicate Objective‑C class registration and related duplicate-symbol issues.

Solution
After packageIosAction completes, if ReactBrownfield.xcframework exists under the package output directory, we run the same stripFrameworkBinary step already used for Brownie.xcframework and BrownfieldNavigation.xcframework. The xcframework stays usable for imports and Swift interfaces, while its Mach-O is replaced with a stub so implementations are not duplicated in apps that embed both BrownfieldLib and ReactBrownfield.xcframework.

Test plan

Before
Before.mov
After
After.mov

Copilot AI review requested due to automatic review settings April 9, 2026 10:17
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the iOS packaging command to prevent duplicate symbol / duplicate Objective‑C class registration issues when consumer apps embed both BrownfieldLib (which already contains ReactBrownfield symbols) and ReactBrownfield.xcframework.

Changes:

  • Add detection of ReactBrownfield.xcframework in the package output directory.
  • Run stripFrameworkBinary on ReactBrownfield.xcframework to make it interface-only when present.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/cli/src/brownfield/commands/packageIos.ts
@artus9033 artus9033 self-requested a review April 9, 2026 10:21
@hurali97 hurali97 merged commit 5ac357b into main Apr 10, 2026
14 checks passed
@hurali97 hurali97 deleted the feat/fix-duplicate-symbols-rnb branch April 10, 2026 04:53
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.

3 participants