diff --git a/.changeset/strict-animals-worry.md b/.changeset/strict-animals-worry.md new file mode 100644 index 00000000..3791a0ea --- /dev/null +++ b/.changeset/strict-animals-worry.md @@ -0,0 +1,5 @@ +--- +'@callstack/brownfield-cli': patch +--- + +fix duplicate symbols for react-brownfield diff --git a/packages/cli/src/brownfield/commands/packageIos.ts b/packages/cli/src/brownfield/commands/packageIos.ts index 4b4cb12c..501f5856 100644 --- a/packages/cli/src/brownfield/commands/packageIos.ts +++ b/packages/cli/src/brownfield/commands/packageIos.ts @@ -1,3 +1,4 @@ +import fs from 'node:fs'; import path from 'node:path'; import { @@ -95,6 +96,17 @@ export const packageIosCommand = curryOptions( platformConfig ); + const reactBrownfieldXcframeworkPath = path.join( + packageDir, + 'ReactBrownfield.xcframework' + ); + if (fs.existsSync(reactBrownfieldXcframeworkPath)) { + // Strip the binary from ReactBrownfield.xcframework to make it interface-only. + // This avoids duplicate symbols when consumer apps embed both BrownfieldLib + // (which contains ReactBrownfield symbols) and ReactBrownfield.xcframework. + stripFrameworkBinary(reactBrownfieldXcframeworkPath); + } + if (hasBrownie) { const productsPath = path.join(options.buildFolder, 'Build', 'Products'); const brownieOutputPath = path.join(packageDir, 'Brownie.xcframework');