react-native-mapbox-gl
react-native-mapbox-gl copied to clipboard
Can't use react-native-mapbox-gl and MapboxNavigation with CocoaPods
Mapbox Navigation SDK version: 0.29.1 react-native-mapbox-gl 6.1.3
Hello, I'm having an issue trying to use the Mapbox iOS Navigation along with the react-native-mapbox-gl module with CocoaPods.
Trying to use them together throws
[!] The 'Pods-abcd' target has frameworks with conflicting names: mapbox.framework.
Steps to reproduce:
-
react-native init abcd
-
cd abcd && npm install @mapbox/react-native-mapbox-gl --save
-
cd ios && touch Podfile
- Copy the following into the Podfile located abcd/ios/Podfile
platform :ios, '9.0'
target 'abcd' do
use_frameworks!
pod 'React', :path => '../node_modules/react-native', :subspecs => [
'Core',
'CxxBridge', # Include this for RN >= 0.47
'RCTImage'
# Add any other subspecs you want to use in your project
]
# Explicitly include Yoga if you are using RN >= 0.42.0
pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga'
# Third party deps podspec link
pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'
# Mapbox
pod 'react-native-mapbox-gl', :path => '../node_modules/@mapbox/react-native-mapbox-gl'
pod 'MapboxNavigation', '~> 0.29.0'
end
-
pod install
- Notice
[!] The 'Pods-abcd' target has frameworks with conflicting names: mapbox.framework.
preventing the creation of the .xcworkspace
Expected behavior:
The two SDKs should be able to be used together.
Thanks !
The incompatibility reported by CocoaPods is caused by the fact that RNMBGL is distributed as Mapbox.framework, which happens to be the same bundle name that the Mapbox Maps SDK for iOS uses:
https://github.com/nitaliano/react-native-mapbox-gl/blob/e4b825275988e9054112139af1f31ad015fa4cf0/react-native-mapbox-gl.podspec#L16
CocoaPods requires each framework embedded within an iOS application target to have a distinct name. (This is a best practice for iOS applications in general.) This error affects any application that uses both RNMBGL and another iOS framework that depends on the iOS map SDK.
@1ec5 is there a quick fix for this on this lib's side? Ex: rename the Mapbox.framework
to RNMapbox.framework
?
We also encountered the naming conflict when trying to use navigation. @kristfal renaming the framework (and where it is referenced) in this lib should resolve the issue
This issue is related to #1533
@mysport12 if you have a workable approach, can you open a PR against #1533 with your additions? With these changes, I agree it makes sense to push towards a pod based installation of this repo.
@ClementPF hi, have you already solved the problem, could you please tell how you solve it, I am still struggling with it.
@ClementPF hi, have you already solved the problem, could you please tell how you solve it, I am still struggling with it.
I have not solved the problem.