1

I am trying to install the Mapbox SDK for an iOS app I am creating. However, I'm running into a slew of errors. I have tried downloading the SDK without any third party apps. However, this gave a "Command PhaseScriptExecution failed with a nonzero exit code". Next, I tried Carthage. However, when I type in "update carthage" into the terminal, I get the error "the xcode build could not be found". Next, I went to xcode and I set the command line tools to xcode 10.1 (which is installed on my computer). Then, when I updated carthage, I received a "task failed with exit code 65" error.

I am just wondering if anyone has any solutions to these problems, or if there is an easier way to install mapbox?

Rohan Singh
  • 461
  • 2
  • 5
  • 20
  • Mapbox give instructions on their website. The instructions work. If the instructions are not working for you then you are doing something wrong. It is impossible to help you without seeing your project. – Magnas Jun 18 '20 at 19:58
  • The Mapbox documentation for Carthage is poor and is very unclear on how different versions of Swift, the numerous frameworks in Mapbox and Xcode play together. I had the same problems as you. I only got it to work after Mapbox finally responded to my emails after about two weeks. I see you finally marked cocoapods as correct answer. I can't speak for Cocoapods but I know that everyone time I update app on app store, the biggest issue is Mapbox. – user6631314 Jul 14 '21 at 03:40

1 Answers1

3

I use CocoaPods and never had problems with it. As you are obviously running macOS the installation is pretty easy.

The installation is done by entering this in a Terminal window

sudo gem install cocoapods

after this you change your directory to your project and either enter

[vim, vi, nano or any other I might forgot] Podfile

and enter this in that file

use_frameworks!

target 'TargetNameForYourApp' do
  pod 'Mapbox-iOS-SDK', '~> 5.9'
end

or touch Podfile and open this with any text editor and enter the same as above.

Finally you enter pod install, wait for the task to finish and you're good to go.

Note you HAVE TO open the yourAppName.xcworkspace else it won't work. To get autocompletion and error checking working you may need to import the Mapbox library in your ViewController (by adding import Mapbox at the to of the file) and build it the project. For further information visit https://www.mapbox.com/install/ios/cocoapods/ and https://cocoapods.org/.

DolphinAir
  • 48
  • 4