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

Error when installing via Cocoapods: 'The following Swift pods cannot yet be integrated as static libraries' #1791

Closed
paul019 opened this issue Oct 21, 2018 · 2 comments

Comments

@paul019
Copy link

paul019 commented Oct 21, 2018

I am trying to install MapboxNavigation in my React Native and iOS project using Cocoapods. My Podfile looks something like this:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'

EXPO_CPP_HEADER_DIR = 'ExpoKit'

target 'pq-app-v2' do
  pod 'Mapbox-iOS-SDK', '~> 4.5',
    :modular_headers => true
  pod 'MapboxNavigation', '~> 0.22.0',
    :modular_headers => true
 pod 'React',
    :path => "../node_modules/react-native",
    :inhibit_warnings => true,
    :subspecs => [
      "Core",
      "ART",
      "RCTActionSheet",
      "RCTAnimation",
      "RCTCameraRoll",
      "RCTGeolocation",
      "RCTImage",
      "RCTNetwork",
      "RCTText",
      "RCTVibration",
      "RCTWebSocket",
      "DevSupport",
      "CxxBridge"
    ]
// ... (some other pods)
end

But when I run pod repo update && pod install in the console I get the following error:

[!] The following Swift pods cannot yet be integrated as static libraries:

The Swift pod `MapboxCoreNavigation` depends upon `MapboxMobileEvents`, which do not define modules. To opt into those targets generating module maps (which is necessary to import them from Swift when building as static libraries), you may set `use_modular_headers!` globally in your Podfile, or specify `:modular_headers => true` for particular dependencies.

The Swift pod `MapboxNavigation` depends upon `MapboxMobileEvents`, which do not define modules. To opt into those targets generating module maps (which is necessary to import them from Swift when building as static libraries), you may set `use_modular_headers!` globally in your Podfile, or specify `:modular_headers => true` for particular dependencies.

I do not understand this error, because I specified :modular_headers => true for the Mapbox dependencies in the Podfile (see above). How can I solve this error?

@frederoni
Copy link
Contributor

@paul019 can you try this as a transitive dependency and report back?

pod 'MapboxMobileEvents', :git => 'https://github.com/mapbox/mapbox-events-ios.git', :commit => "79d29f1df5a9187481f5c9ac8fa13430d1f04139"

@1ec5
Copy link
Contributor

1ec5 commented Mar 13, 2019

The line above is in order to get the fix in mapbox/mapbox-events-ios#85, which has already been merged and released. So you should only have to pod update in order to verify whether the fix works. Please open a new issue if the error persists.

Aside from that, RNMBGL v6.x depends on a very old version of the iOS map SDK. v7.x will likely be based on a compatible version. It’s being developed in nitaliano/react-native-mapbox-gl#1377; see nitaliano/react-native-mapbox-gl#1238 (comment) for the latest progress update.

@1ec5 1ec5 closed this as completed Mar 13, 2019
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

3 participants