Troubleshooting

Troubleshooting Mapbox Maps SDK for iOS installation

CocoaPods Installation

If you're already using CocoaPods to manage dependencies in your project, we suggest installing the Mapbox Maps SDK for iOS in the same way. If you run into issues while installing the framework with CocoaPods, try following these steps:

  • Use the most recent version of CocoaPods. Beta versions are not recommended for use with the Mapbox Maps SDK for iOS.
  • If pod install gives you an “Unable to find a specification” error, try running pod repo update first.
  • When you run pod install, CocoaPods generates an xcworkspace file that includes its configuration. The xcworkspace file has a white Xcode icon, unlike the xcodeproj file which has a blue Xcode icon. Make sure you're opening this file and not the original Xcode project.
  • If you see the error Mapbox.h not found, this can typically be resolved by building your application despite the error.
  • If you're getting a permission error or having trouble installing CocoaPods itself, consult the CocoaPods troubleshooting documentation.
  • If you're using version v6.0.0 of the SDK or later, you will need to authorize your download of the Maps SDK with a secret access token with the Downloads:Read scope. Otherwise, you will see the following error:
[!] Error installing Mapbox-iOS-SDK
curl: (22) The requested URL returned error: 401 Unauthorized

To resolve this, create a secret access token from your Mapbox account and follow the instructions outlined in the installation guide to configure your secret token.

If you're still having issues using Mapbox with CocoaPods, please contact support with the complete details of the issue, including error messages.

Carthage installation

  • Make sure you're using Carthage version 0.35.0 or above.
  • If you're using version v6.0.0 of the SDK or later, you will need to authorize your download of the Maps SDK with a secret access token with the Downloads:Read scope. Otherwise, you will see the following error:
A shell task (/usr/bin/env unzip -uo -qq -d .../mapbox-ios-sdk-dynamic.zip) failed with exit code 9:
[.../mapbox-ios-sdk-dynamic.zip]
  End-of-central-directory signature not found.  Either this file is not
  a zipfile, or it constitutes one disk of a multi-part archive.  In the
  latter case the central directory and zipfile comment will be found on
  the last disk(s) of this archive.
unzip:  cannot find zipfile directory in one of .../mapbox-ios-sdk-dynamic.zip or
        .../mapbox-ios-sdk-dynamic.zip.zip, and cannot find .../mapbox-ios-sdk-dynamic.zip.ZIP, period.

To resolve this, create a secret access token from your Mapbox account and follow the instructions outlined in the installation guide to configure your secret token.

  • If you continue to run into the same error after including your ~/.netrc file, try clearing your Carthage cache and try installing again:
rm -rf Carthage && 
rm Cartfile.resolved && 
rm -rf ~/Library/Caches/carthage && 
rm -rf ~/Library/Caches/org.carthage.CarthageKit

General Troubleshooting

If your app successfully builds, but you see 401 responses to requests, make sure that you've set your access token correctly. Note that installing v6.0.0 or greater via Carthage or CocoaPods requires two tokens: one to download the SDK and another to authenticate map requests.

Was this page helpful?