Repository navigation
fix(ios): find the Swift header when pods build as frameworks - #35
Merged
Merged
Conversation
With use_frameworks! (e.g. expo-build-properties useFrameworks: "static") the generated header is only reachable as <rnmapbox_navigation/rnmapbox_navigation-Swift.h>.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With
use_frameworks!(e.g.expo-build-propertiesios.useFrameworks: "static"), Xcode writes the generated header intornmapbox_navigation.framework/Headers, so it can only be imported as<rnmapbox_navigation/rnmapbox_navigation-Swift.h>. Our four.mmfiles used#import "rnmapbox_navigation-Swift.h"and the build failed with'rnmapbox_navigation-Swift.h' file not found(reported from an EAS build). The newios/rnmapbox_navigation-Swift.pre.hpicks whichever form exists, the same wayrnmapbox_maps-Swift.pre.hdoes in @rnmapbox/maps.Repro: use expo-example with this plugin added to
app.json, and set"EXPO_USE_PRECOMPILED_MODULES": "false"inios/Podfile.properties.jsonafter prebuild. On SDK 58 the precompiled-modules pipeline turnsUSE_FRAMEWORKSoff for the rnmapbox pods, which hides the bug.Then
pod installandxcodebuild -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.mmandRNMBXNavigationModule.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 verifyuseFrameworks: "dynamic":rnmapbox-mapsfails to link (missing MapboxMaps symbols) before any navigation source compiles, with or without this change.