Troubleshooting Mapbox Maps and Navigation SDKs for iOS installation
Learn how to troubleshoot issues when installing the Mapbox Maps or Navigation SDK for iOS with Swift Package Manager, CocoaPods, and Carthage.
General troubleshooting
If you see 401 responses after your app builds successfully, make sure that you've configured all credentials correctly. Note that installing Maps SDK v6.0.0, Navigation SDK v1.0.0, or Search SDK v1.0.0 or greater via Carthage or CocoaPods requires two access tokens: one to download the SDK and another to authenticate map requests.
Swift Package Manager
Swift Package Manager (SPM) is the recommended method for installing the Maps SDK. If you run into issues while installing the framework with SPM, try following these steps:
- Xcode may fail to resolve SPM artifacts with errors such as
artifact of binary target 'MapboxCommon' failed extraction: The operation couldn’t be completed. (TSCBasic.StringError error 1.). If these errors occur, try resetting the SPM cache by opening the File menu in Xcode and selecting Swift Packages > Reset Package Cache. You may also need to delete your derived data folder.
CocoaPods
Though Swift Package Manager is the preferred method for installing the Maps SDK, if you're already using CocoaPods to manage other dependencies in your project, you can also install the Mapbox SDKs 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 installgives you an “Unable to find a specification” error, try runningpod repo updatefirst. - When you run
pod install, CocoaPods generates anxcworkspacefile that includes its configuration. Thexcworkspacefile has a white Xcode icon, unlike thexcodeprojfile which has a blue Xcode icon. Make sure you're opening this file and not the original Xcode project. - If you're getting a permission error or having trouble installing CocoaPods itself, consult the CocoaPods troubleshooting documentation.
If you're still having issues using Mapbox with CocoaPods, contact support with the complete details of the issue, including error messages.