Repository navigation
Description
Mapbox Version
11.23.1 (default MapboxMaps via CocoaPods)
React Native Version
0.88.0 (New Architecture)
Platform
iOS
@rnmapbox/maps version
10.3.10. The same podspec code is in 10.3.11 and on main.
Standalone component to reproduce
This is a build/link failure, not a runtime one, so any component reproduces it. For example:
import React from 'react';
import Mapbox from '@rnmapbox/maps';
export default function App() {
return <Mapbox.MapView style={{ flex: 1 }} />;
}The trigger is the iOS framework linkage. In an Expo app (SDK 58):
["expo-build-properties", { "ios": { "useFrameworks": "dynamic" } }]Observed behavior and steps to reproduce
Environment:
- Expo SDK 58.0.19
- React Native 0.88.0
- React 19.3.0
- Xcode 27.1
- CocoaPods 1.17.0
expo-build-properties58.0.11
Steps:
- Expo SDK 58 app with
@rnmapbox/maps. - Set
expo-build-propertiesios.useFrameworksto"dynamic". npx expo prebuild -p ios --clean && cd ios && pod install- Build for the iOS simulator.
Observed: linking rnmapbox_maps.framework fails:
Undefined symbols for architecture arm64:
"google::LogMessage::stream()", referenced from: ...
"google::LogMessage::LogMessage(char const*, int, int)", referenced from: ...
ld: symbol(s) not found for architecture arm64
** BUILD FAILED ** (failed target: rnmapbox-maps)
Why dynamic linkage: React Native Firebase 27 (Firebase Apple SDK 13) is distributed only through Swift Package Manager. It requires useFrameworks: "dynamic" and rejects static linkage at prebuild (https://rnfirebase.io/ios-spm). So apps that use both Firebase and @rnmapbox/maps on Expo SDK 58 have to build rnmapbox as a dynamic framework. With @rnmapbox/maps removed and the same config, the app builds. Firebase, Intercom, Nutrient, Notifee and other native modules all link as dynamic frameworks.
Expected behavior
rnmapbox_maps.framework links with useFrameworks: "dynamic", the same as with static frameworks.
Notes / preliminary analysis
The cause is in rnmapbox-maps.podspec (line 369 on main). The New Architecture branch calls install_modules_dependencies(sp) and then removes some of those dependencies:
install_modules_dependencies(sp)
dependencies_only_requiring_modular_headers = ["React-Fabric", "React-graphics", "React-utils", "React-debug", "glog"]
sp.dependencies = sp.dependencies.select { |d| !dependencies_only_requiring_modular_headers.include?(d.name) }.map {|d| [d.name, []]}.to_hWith static linkage, the app target resolves these symbols at the final link. With dynamic frameworks, rnmapbox_maps.framework is linked on its own, so the stripped pods' symbols are missing.
I tested this locally, one step at a time:
- Removing only
"glog"from that list fixes the glog symbols. The link then fails on React-Fabric symbols, for example:facebook::react::EventEmitter::EventEmitter(std::shared_ptr<facebook::react::EventTarget>, std::weak_ptr<facebook::react::EventDispatcher const>) facebook::react::EventEmitter::setShadowNodeFamily(...) facebook::react::EventTarget::EventTarget(std::shared_ptr<facebook::react::InstanceHandle const>, int) facebook::react::RawPropsParser::postPrepare() - With an empty list, so that all
install_modules_dependenciesdependencies are kept,rnmapbox_maps.frameworklinks and the app builds (** BUILD SUCCEEDED **) with dynamic frameworks and Firebase 27.
- dependencies_only_requiring_modular_headers = ["React-Fabric", "React-graphics", "React-utils", "React-debug", "glog"]
+ dependencies_only_requiring_modular_headers = []Suggested fix: only apply this filtering when the pod is not built as a dynamic framework. For example, skip it when ENV['USE_FRAMEWORKS'] == 'dynamic'. That keeps the current behaviour for static builds.
This probably explains #3910 and #4052, which showed the same google::LogMessage undefined symbols in rnmapbox_maps and were closed without a root cause.
Additional links and references
- [iOS] Error while building after upgrade #3910, [iOS] Error while migrating to new arch #4052: same undefined
google::LogMessagesymbols when linkingrnmapbox_maps - [Bug]: 'rnmapbox_maps/rnmapbox_maps-Swift.h' file not found — RNMBX_USE_FRAMEWORKS mismatch under Expo SDK 57 with static linkage #4242, Swift header 'rnmapbox_maps-Swift.h' not found when useFrameworks: static (Expo SDK 57 / Xcode 26) #4243, [Bug]: Swift header 'rnmapbox_maps-Swift.h' not found when useFrameworks: static (Expo SDK 57 / Xcode 26) #4244: related Expo SDK 57 framework issues, but for static frameworks
- https://rnfirebase.io/ios-spm: Firebase 27 requires SPM and dynamic frameworks
- [🐛] [runtime not ready]: Error: Native module NativeRNFBTurboApp is not registered. iOS bearworkflow EXPO/RN invertase/react-native-firebase#9354: apps hitting the static-vs-dynamic conflict with Firebase 27
Activity
fix(ios): keep React-Fabric and glog pod dependencies so dynamic fram…