Mapbox-iOS-SDK 6.3.0 pod install error 403 Forbidden
Asked Answered
H

4

8

download Mapbox example, run pod install, error: 403 Forbidden, why? please help, thank you!

pod 'Mapbox-iOS-SDK', '~> 6.3.0'

➜ ios-sdk-examples-298e050be7352eb28cee6f03e02945593140c1f3 pod install Analyzing dependencies Downloading dependencies Installing Mapbox-iOS-SDK 6.3.0

[!] Error installing Mapbox-iOS-SDK [!] /usr/bin/curl -f -L -o /var/folders/84/rnxy4n6d32g03yxywry6hlnx0l2qqr/T/d20210316-90167-1gkenam/file.zip https://api.mapbox.com/downloads/v2/mobile-maps/releases/ios/packages/6.3.0/mapbox-ios-sdk-dynamic.zip --create-dirs --netrc-optional --retry 2 -A 'CocoaPods/1.10.0 cocoapods-downloader/1.4.0'

% Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 curl: (22) The requested URL returned error: 403 Forbidden

machine api.mapbox.com
  login xxx
  password xxx <sk.eyJ1IjoiY2hpYnVkb25nIiwiYSI6ImNrbWJlN2RhNzIwcTEyb210ZTRtbXM2MDAifQ.DkqGccMXylJmAG9G6OSfYg>
Horton answered 16/3, 2021 at 2:53 Comment(2)
You can remove the secret token, it could be misused.Melli
What worked for me was to create another token and use that one.Overtake
C
17

Make sure that you have DOWNLOADS:READ permission when creating the secret token.

enter image description here

Chrissy answered 4/4, 2021 at 23:27 Comment(1)
This was made my dayJaymejaymee
S
4

you should edit your .netrc file to:

machine api.mapbox.com
login mapbox
password sk.eyJ1IjoiY2hpYnVkb25nIiwiYSI6ImNrbWJlN2RhNzIwcTEyb210ZTRtbXM2MDAifQ.DkqGccMXylJmAG9G6OSfYg

and you should take your SECRET TOKEN instead of default PUBLIC TOKEN

Sparker answered 21/7, 2021 at 21:57 Comment(2)
You can remove the secret token, it could be misused.Melli
that is not importantSparker
T
0

You must have a SECRET token from MapBox (not public).

Note: a SECRET token is created when you grant any "Secret Scopes" when creating the token in the Mapbox dashboard.

Then create this file and add your SECRET token:

touch ~/.netrc
echo "machine api.mapbox.com" > ~/.netrc
echo "login mapbox" >> ~/.netrc
echo "password <INSERT SECRET TOKEN>" >> ~/.netrc

Now pod install will work.

Tumefaction answered 6/9, 2023 at 18:15 Comment(0)
G
0

I solve this with netrbut I have another problem when I use code push it’s success but doesn’t update reflect in real device so I go to app center and build with GitHub source code I got mapbox authorization error what should I do ? Btw sry for my English

Galacto answered 4/12, 2023 at 6:33 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.