Skip to content

iOS archive fails on Xcode 26: “RaTeX.xcframework-ios.signature” (0.7.x, math enabled) #491

Description

@lisabaut

Issue

iOS archive fails on Xcode 26: “RaTeX.xcframework-ios.signature” couldn’t be copied to “Signatures” because an item with the same name already exists (0.7.x, math enabled)

Environment

  • react-native-enriched-markdown: 0.7.2 (0.7.0 ships the identical RaTeX integration and is presumably affected — see “Secondary observation” for what we hit there)
  • react-native: 0.85.3, Expo SDK 56 (CNG/prebuild), static linkage (default, no use_frameworks!)
  • Xcode 26.4 (17E202) — EAS Build image macos-tahoe-26.4-xcode-26.4
  • Fails on xcodebuild archive (device builds / EAS / Organizer). xcodebuild build (simulator, run:ios, Release device installs) is unaffected.

Summary

Since 0.7.0, math rendering pulls in the RaTeX XCFramework as a Swift Package via React Native’s spm_dependency. Compilation and linking succeed — even with static linkage — but archiving fails during archive assembly:

xcodebuild: error: “RaTeX.xcframework-ios.signature” couldn’t be copied to “Signatures”
because an item with the same name already exists.: The operation couldn’t be completed. File exists
Exit status: 70

Root cause

Xcode runs SignatureCollection for the RaTeX XCFramework twice — once for the RaTeX SPM product target and once for the ReactNativeEnrichedMarkdown pod target — producing two files with the same basename in different build-products directories:

Release-iphoneos/RaTeX.xcframework-ios.signature
Release-iphoneos/ReactNativeEnrichedMarkdown/RaTeX.xcframework-ios.signature

During archive assembly, Xcode copies all collected signatures into the flat <archive>/Signatures/ directory, and the second copy collides with the first.

This is a known Xcode 26 failure class for signed binary XCFrameworks consumed via SPM alongside CocoaPods. Prior art:

Suggested fix

Same approach as dotlottie: delete the pod-target copy after compile, e.g. appended to the existing Fix RaTeXFFI Module Redefinition script phase in ReactNativeEnrichedMarkdown.podspec (it is a no-op when the file doesn’t exist, so it’s safe on older Xcode versions and simulator builds):

rm -rf "${CONFIGURATION_BUILD_DIR}/RaTeX.xcframework-ios.signature"

Alternatively, vendoring RaTeX as an XCFramework pod dependency instead of spm_dependency would eliminate this entire class of SPM/CocoaPods interop issues (see also “Secondary observation” below).

Workaround for affected users (verified)

Expo users can apply the dedupe app-side with a config plugin that injects the same rm into the Podfile’s post_install as a build phase on the ReactNativeEnrichedMarkdown target:

post_install do |installer|
  installer.pods_project.targets.each do |target|
    next unless target.name == 'ReactNativeEnrichedMarkdown'
    phase = target.new_shell_script_build_phase('Dedupe RaTeX XCFramework Signature')
    phase.shell_script = 'rm -rf "${CONFIGURATION_BUILD_DIR}/RaTeX.xcframework-ios.signature"'
    phase.always_out_of_date = '1'
  end
end

Secondary observation (transient)

On our first 0.7.0 archive attempt on the same Xcode 26.4 image, xcodebuild -resolvePackageDependencies (and the subsequent archive) crashed while loading the Pods project containing the CocoaPods-written XCRemoteSwiftPackageReference:

-[XCRemoteSwiftPackageReference _setSavedArchiveVersion:]: unrecognized selector sent to instance
Exception: … The project ‘Pods’ is damaged and cannot be opened.

xcodebuild then silently proceeded without the Pods project (target dependency graph collapsed from 155 to 2 targets), so every pod modulemap was missing and the build failed with no such module 'Expo'. This did not reproduce on the next build (0.7.2 — identical podspec/SPM integration), so it appears non-deterministic — but it’s a second data point that the SPM-package-inside-Pods-project setup is fragile on current Xcode, and another argument for the vendored-XCFramework route.

Reproduction

  1. Expo SDK 56 app, react-native-enriched-markdown 0.7.x, math enabled (default), static linkage (default).
  2. eas build --platform ios with any device profile (or archive in Xcode/Organizer) on Xcode 26.4.
  3. Build compiles and links, then fails at archive assembly with the signature collision above.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions