Reputation: 471
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?
Upvotes: 1
Views: 2319
Reputation: 48
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/.
Upvotes: 3