Description
Description
When I add the Mapbox Navigation SDK v3 (via Swift Package Manager) into an existing React Native iOS project that already uses rnmapbox-maps (via CocoaPods), the Xcode 15 build fails with “Multiple commands produce” errors for Turf.framework, MapboxCoreMaps.framework and MapboxCommon.framework. I’ve tried patching the CocoaPods embed script and looking for an “Embed Swift Package Libraries” phase to disable, but nothing stops the duplicate-embed.
⸻
Steps to Reproduce
- Setup React Native map:
- Add rnmapbox-maps to your Podfile and run pod install.
- Add Navigation via SPM:
- In Xcode, File → Add Packages…
- URL: https://github.com/mapbox/mapbox-navigation-ios.git
- Version: Up to Next Major Version 3.9.1
- Configure tokens & permissions (per Mapbox docs)
- Build in Xcode 15 (macOS Sonoma)
You will see errors like:
Multiple commands produce '/…/Build/Products/Debug-iphonesimulator/MyApp.app/Frameworks/Turf.framework'
Multiple commands produce '/…/Build/Products/Debug-iphonesimulator/MyApp.app/Frameworks/MapboxCoreMaps.framework'
Multiple commands produce '/…/Build/Products/Debug-iphonesimulator/MyApp.app/Frameworks/MapboxCommon.framework'
⸻
What I Expected
- Each framework should be embedded only once (either via CocoaPods or via SPM)
- Build succeeds without manual script hacks
⸻
What Happened Instead
- CocoaPods’ [CP] Embed Pods Frameworks phase and Xcode’s SPM embed phase both try to copy the same frameworks.
- Attempts to patch Pods-MyApp-frameworks.sh to skip those frameworks did not resolve the “Multiple commands produce” errors.
- I do not see any “Embed Swift Package Libraries” or “Embed Package Products” phase in my target’s Build Phases to disable.
⸻
Build Log Snippet
error: Multiple commands produce '/…/Frameworks/Turf.framework'
note: Target 'MyApp' has copy command from '…/Turf.xcframework/ios-arm64_x86_64-simulator/Turf.framework' to '/…/Frameworks/Turf.framework'
note: That command depends on command in Target 'MyApp': script phase “[CP] Embed Pods Frameworks”
...

⸻
Attempts at a Fix
- Patching install_framework() in Pods-MyApp-frameworks.sh to return early for Turf/MapboxCoreMaps/MapboxCommon
- Searching for and disabling any SPM embed phase in Xcode UI
None have eliminated the duplicate-embed errors.
⸻
Request
Could you advise on the official way to integrate Mapbox Navigation v3 via SwiftPM and rnmapbox-maps via CocoaPods in the same project, so that Turf, MapboxCoreMaps and MapboxCommon are only embedded once and the build succeeds?