Mapbox Version
default (MapboxCoreMaps 11.20.3 / MapboxMaps 11.20.3, as resolved by rnmapbox-maps 10.3.1)
React Native Version
0.86.0
Platform
iOS
@rnmapbox/maps version
10.3.1 (also confirmed on 10.3.2-rc.1, which only contains an unrelated Android fix)
Standalone component to reproduce
import Mapbox from '@rnmapbox/maps';
import { StyleSheet } from 'react-native';
const BugReport = () => {
return (
<Mapbox.MapView style={styles.map}>
<Mapbox.Camera centerCoordinate={[15.97, 45.81]} zoomLevel={14} />
</Mapbox.MapView>
);
};
const styles = StyleSheet.create({
map: { flex: 1 },
});
export default BugReport;
Observed behavior and steps to reproduce
Building fails during compilation of the rnmapbox-maps pod target with:
'rnmapbox_maps/rnmapbox_maps-Swift.h' file not found
#if RNMBX_USE_FRAMEWORKS
#import <rnmapbox_maps/rnmapbox_maps-Swift.h>
#else
#import <rnmapbox_maps-Swift.h>
#endif
(from node_modules/@rnmapbox/maps/ios/RNMBX/rnmapbox_maps-Swift.pre.h)
Environment:
- Expo SDK 57.0.2
- React Native 0.86.0
- New Architecture: enabled
- Xcode 26 (building via EAS Build, iPhoneSimulator26.4.sdk)
- CocoaPods 1.16.2
- iOS build configured with useFrameworks: static (via expo-build-properties), required because the project also uses @react-native-firebase (auth + app), which requires static linkage
During pod install, Expo's build pipeline logs:
[Expo] Disabling USE_FRAMEWORKS for 89 pods (... rnmapbox-maps ...)
This explicitly disables framework-style compilation for the rnmapbox-maps target, building it as a plain static library rather than a .framework. However, RNMBX_USE_FRAMEWORKS still evaluates truthy at compile time, so the code takes the framework-style import path, which only exists when the pod is actually compiled as a framework. Since it isn't under this configuration, the header can't be found.
Separately, and possibly related: this project also hit a CocoaPods TargetValidator error (verify_no_static_framework_transitive_dependencies) triggered by rnmapbox-maps's own Podfile hook forcing its underlying MapboxCommon / MapboxCoreMaps / MapboxMaps / Turf pods to dynamic frameworks, while the rest of the project (including rnmapbox-maps itself, and Firebase) is static. I worked around that specific error with a custom Podfile patch, which allowed pod install to succeed — but the Swift header issue above then surfaces during the actual Xcode compile step.
Expected behavior
rnmapbox-maps should compile successfully when the consuming project requires useFrameworks: static (e.g. due to a Firebase dependency) alongside RN 0.86 / Expo SDK 57's New Architecture build pipeline, which explicitly disables framework-style compilation for this pod. The Swift header import should resolve to the non-framework path (<rnmapbox_maps-Swift.h>) in that case, matching how the pod is actually being compiled.
Notes / preliminary analysis
I attempted to force RNMBX_USE_FRAMEWORKS=0 via GCC_PREPROCESSOR_DEFINITIONS on the rnmapbox-maps target in a Podfile post_install hook (both immediately after post_install's opening line, and again at the very end of the block to rule out an ordering/overwrite issue). Neither had any effect on the compile-time macro value. This suggests the macro may be controlled by a mechanism other than GCC_PREPROCESSOR_DEFINITIONS — possibly set directly in the pod's own generated xcconfig, or via a build step that regenerates rnmapbox_maps-Swift.pre.h or a related file at a point after post_install runs.
I also tried forcing DEFINES_MODULE=YES on the target directly — no effect on this specific error.
Question for maintainers: is there a documented/supported way to force non-framework Swift header resolution for rnmapbox-maps when a consuming project requires static linkage project-wide? Or is static linkage + New Architecture + Expo SDK 57 currently an unsupported combination for this library?
Additional links and references
Related closed issue (different symptom, same Xcode 26 / New Architecture territory): #4178
Mapbox Version
default (MapboxCoreMaps 11.20.3 / MapboxMaps 11.20.3, as resolved by rnmapbox-maps 10.3.1)
React Native Version
0.86.0
Platform
iOS
@rnmapbox/mapsversion10.3.1 (also confirmed on 10.3.2-rc.1, which only contains an unrelated Android fix)
Standalone component to reproduce
import Mapbox from '@rnmapbox/maps';
import { StyleSheet } from 'react-native';
const BugReport = () => {
return (
<Mapbox.MapView style={styles.map}>
<Mapbox.Camera centerCoordinate={[15.97, 45.81]} zoomLevel={14} />
</Mapbox.MapView>
);
};
const styles = StyleSheet.create({
map: { flex: 1 },
});
export default BugReport;
Observed behavior and steps to reproduce
Building fails during compilation of the
rnmapbox-mapspod target with:'rnmapbox_maps/rnmapbox_maps-Swift.h' file not found
#if RNMBX_USE_FRAMEWORKS
#import <rnmapbox_maps/rnmapbox_maps-Swift.h>
#else
#import <rnmapbox_maps-Swift.h>
#endif
(from node_modules/@rnmapbox/maps/ios/RNMBX/rnmapbox_maps-Swift.pre.h)
Environment:
During
pod install, Expo's build pipeline logs:[Expo] Disabling USE_FRAMEWORKS for 89 pods (... rnmapbox-maps ...)
This explicitly disables framework-style compilation for the rnmapbox-maps target, building it as a plain static library rather than a .framework. However, RNMBX_USE_FRAMEWORKS still evaluates truthy at compile time, so the code takes the framework-style import path, which only exists when the pod is actually compiled as a framework. Since it isn't under this configuration, the header can't be found.
Separately, and possibly related: this project also hit a CocoaPods TargetValidator error (verify_no_static_framework_transitive_dependencies) triggered by rnmapbox-maps's own Podfile hook forcing its underlying MapboxCommon / MapboxCoreMaps / MapboxMaps / Turf pods to dynamic frameworks, while the rest of the project (including rnmapbox-maps itself, and Firebase) is static. I worked around that specific error with a custom Podfile patch, which allowed pod install to succeed — but the Swift header issue above then surfaces during the actual Xcode compile step.
Expected behavior
rnmapbox-mapsshould compile successfully when the consuming project requires useFrameworks: static (e.g. due to a Firebase dependency) alongside RN 0.86 / Expo SDK 57's New Architecture build pipeline, which explicitly disables framework-style compilation for this pod. The Swift header import should resolve to the non-framework path (<rnmapbox_maps-Swift.h>) in that case, matching how the pod is actually being compiled.Notes / preliminary analysis
I attempted to force RNMBX_USE_FRAMEWORKS=0 via GCC_PREPROCESSOR_DEFINITIONS on the rnmapbox-maps target in a Podfile post_install hook (both immediately after post_install's opening line, and again at the very end of the block to rule out an ordering/overwrite issue). Neither had any effect on the compile-time macro value. This suggests the macro may be controlled by a mechanism other than GCC_PREPROCESSOR_DEFINITIONS — possibly set directly in the pod's own generated xcconfig, or via a build step that regenerates rnmapbox_maps-Swift.pre.h or a related file at a point after post_install runs.
I also tried forcing DEFINES_MODULE=YES on the target directly — no effect on this specific error.
Question for maintainers: is there a documented/supported way to force non-framework Swift header resolution for rnmapbox-maps when a consuming project requires static linkage project-wide? Or is static linkage + New Architecture + Expo SDK 57 currently an unsupported combination for this library?
Additional links and references
Related closed issue (different symptom, same Xcode 26 / New Architecture territory): #4178