mapbox-directions-swift: Error `'MapboxDirections/MapboxDirections.h' file not found` after installing MapboxNavigation

Hi there,

I’ve installed MapboxNavigation iOS via CocoaPods without experiencing any issues. But after compiling the project in Xcode I got two errors produced by the library. One error is 'MapboxDirections/MapboxDirections.h' file not found:

bildschirmfoto 2018-11-05 um 20 40 35

I tried to just comment out the line of code that produced the error and the whole project indeed compiled successfully. As I can evaluate the import that produces the error isn’t needed in the file at all. Is this true?

After doing this hacky bugfix, I started writing some lines of Mapbox code and got another error:

The code:

import Foundation
import UIKit
import MapboxCoreNavigation
import MapboxNavigation
import MapboxDirections
  ...
let navigationService = MapboxNavigationService(route: route, simulating: .always)
let navigationController = NavigationViewController(for: route, navigationService: navigationService)
viewController.addChildViewController(navigationController);
viewController.addSubview(navigationController.view);

The resulting error: Command failed due to signal: Abort trap: 6

I’ve no clue what this error means and think that it may have something to do with my hacky bugfix. Is this possible?

Mapbox Navigation SDK version: 0.22.0

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 27 (12 by maintainers)

Most upvoted comments

It’s not a long-term solution but I was able to work around this issue by renaming MapboxDirections.swift to MapboxDirections and using the following Podfile:

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

target 'my-app' do
  pod 'MapboxCoreNavigation', :path => '../mapbox-navigation-ios'
  pod 'MapboxNavigation', :path => '../mapbox-navigation-ios'
  pod 'MapboxMobileEvents', :modular_headers => true
  pod 'MapboxDirections', :path => '../MapboxDirections.swift', :modular_headers => true
end

along with renaming MapboxDirections.swift.podspec to MapboxDirections.podspec and edit MapboxCoreNavigation.podspec to depend on MapboxDirections instead of MapboxDirections.swift.

I know there was an issue with . in framework names in Xcode 6/7, but the bug seems to have re-surfaced, at least with static frameworks.

Add use_frameworks! below platform :ios, '9.0' and it should work.

Feel free to re-open if the issue persists.