Skip to content

fix(ios): find the Swift header when pods build as frameworks - #35

Merged
mfazekas merged 1 commit into
mainfrom
fix/swift-header-use-frameworks
Nov 1, 2026
Merged

mfazekas merged 1 commit into
mainfrom
fix/swift-header-use-frameworks

Conversation

@mfazekas

@mfazekas mfazekas commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

With use_frameworks! (e.g. expo-build-properties ios.useFrameworks: "static"), Xcode writes the generated header into rnmapbox_navigation.framework/Headers, so it can only be imported as <rnmapbox_navigation/rnmapbox_navigation-Swift.h>. Our four .mm files used #import "rnmapbox_navigation-Swift.h" and the build failed with 'rnmapbox_navigation-Swift.h' file not found (reported from an EAS build). The new ios/rnmapbox_navigation-Swift.pre.h picks whichever form exists, the same way rnmapbox_maps-Swift.pre.h does in @rnmapbox/maps.

Repro: use expo-example with this plugin added to app.json, and set "EXPO_USE_PRECOMPILED_MODULES": "false" in ios/Podfile.properties.json after prebuild. On SDK 58 the precompiled-modules pipeline turns USE_FRAMEWORKS off for the rnmapbox pods, which hides the bug.

["expo-build-properties", { "ios": { "useFrameworks": "static" } }]

Then pod install and xcodebuild -workspace ios/NavigationExpoExample.xcworkspace -scheme NavigationExpoExample -configuration Debug -destination 'generic/platform=iOS Simulator' CODE_SIGNING_ALLOWED=NO build.

Verified with generic-simulator builds. Before the fix, static frameworks fail in RNMBXNavigationRoutesPlatform.mm and RNMBXNavigationModule.mm, matching the reporter's log. After it, static frameworks, the default expo-example (no frameworks) and the bare example all build. I couldn't verify useFrameworks: "dynamic": rnmapbox-maps fails to link (missing MapboxMaps symbols) before any navigation source compiles, with or without this change.

With use_frameworks! (e.g. expo-build-properties useFrameworks: "static")
the generated header is only reachable as
<rnmapbox_navigation/rnmapbox_navigation-Swift.h>.
@mfazekas
mfazekas merged commit 16042bb into main Nov 1, 2026
6 checks passed
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.

1 participant