3

I am trying to follow MapBox iOS SDK on my project through Swift package Manager dependency. Facing issue in setup.

Followed MapBox Guidelines : https://docs.mapbox.com/ios/maps/guides/install/

Error: mapbox-maps-ios could not be resolved

Steps already tried:

  • Cleaned up Derived data.
  • Also tried to setup with new sample app, no luck for me.

Error Screenshot: enter image description here

Santosh Singh
  • 765
  • 11
  • 27

1 Answers1

0

I had the exact same issue. Please do the following to solve it:

Open your Terminal and enter:

  1. cd
  2. touch .netrc
  3. open .netrc

Paste the following and ONLY replace PRIVATE_MAPBOX_API_TOKEN with your secrete Mapbox Api Token:

machine api.mapbox.com
login mapbox
password PRIVATE_MAPBOX_API_TOKEN

It now should look something like this. It is crucial that you do not include the "<>":

machine api.mapbox.com
login mapbox
password sk.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Now give it another try :-)

SPEEDBIRD
  • 9
  • 2
  • 2
    This doesn't work! – Asteroid Jul 21 '22 at 15:47
  • In my case, the token created is the private one, and it needs to be setup with the Downloads:read permission – Marcio Cabral Sep 20 '22 at 19:53
  • 1
    On Xcode `v14.2`, these instructions did work for me BUT, after setting up the `~/.netrc` file, I had to (a) reset the Package Caches (`File > Packages > Reset Package Caches`), and (b) restart Xcode. – rtorres Mar 05 '23 at 20:33