Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't use react-native-mapbox-gl and MapboxNavigation with CocoaPods #1535

Open
ClementPF opened this issue Mar 11, 2019 · 7 comments
Open

Comments

@ClementPF
Copy link

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:

  1. react-native init abcd
  2. cd abcd && npm install @mapbox/react-native-mapbox-gl --save
  3. cd ios && touch Podfile
  4. 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
  1. pod install
  2. 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 !

@1ec5
Copy link
Contributor

1ec5 commented Mar 13, 2019

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:

s.vendored_frameworks = 'ios/Mapbox.framework'

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.

@kristfal
Copy link
Collaborator

@1ec5 is there a quick fix for this on this lib's side? Ex: rename the Mapbox.framework to RNMapbox.framework ?

@mysport12
Copy link

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

@mysport12
Copy link

This issue is related to #1533

@kristfal
Copy link
Collaborator

@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.

@Jackyaung
Copy link

@ClementPF hi, have you already solved the problem, could you please tell how you solve it, I am still struggling with it.

@ClementPF
Copy link
Author

@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.

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

No branches or pull requests

5 participants