maps: Error installing MapboxCommon (pod install error)

Environment

  • Dev OS: MacOS 13.2
  • React Native: 0.70.6
  • Mapbox: v10.0.0-beta.65 (was beta.33 before)

Steps to reproduce

I wanted to update mapbox but when trying to pod install I get the error shown below. I do have a valid .netrc file with a secret key from mapbox (with downloads:read rights). Also as I mentioned before I was trying to update mapbox, so I did work perfectly before.

/node_modules/@rnmapbox/maps/rnmapbox-maps.podspec:91: warning: already initialized constant Pod::MapboxImplVersion
/node_modules/@rnmapbox/maps/rnmapbox-maps.podspec:91: warning: previous definition of MapboxImplVersion was here Downloading dependencies
Installing MapboxCommon 23.2.1 (was 22.1.0)

[!] Error installing MapboxCommon
[!] /usr/bin/curl -f -L -o /var/folders/zr/c3cpjz893wz6st4jvbl0kd6m0000gn/T/d20230130-88977-1sk48u/file.zip https://api.mapbox.com/downloads/v2/mapbox-common/releases/ios/packages/23.2.1/MapboxCommon.zip --create-dirs --netrc-optional --retry 2 -A 'CocoaPods/1.11.3 cocoapods-downloader/1.6.3'

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

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 1
  • Comments: 20 (5 by maintainers)

Most upvoted comments

I got solution: Open terminal Type open .netrc Paste following in .netrc file

machine api.mapbox.com
login mapbox
password <mapbox_tocken>

Save the file and now run pod install

Refer: https://stackoverflow.com/questions/64007478/cocoapods-error-installing-mapbox-ios-sdk

Nothing worked for me. My fix was to be sure that downloads:read was selected when creating token.

Capture d’écran 2023-08-03 à 23 36 18

x

Environment

  • Dev OS: MacOS 13.2
  • React Native: 0.70.6
  • Mapbox: v10.0.0-beta.65 (was beta.33 before)

Steps to reproduce

I wanted to update mapbox but when trying to pod install I get the error shown below. I do have a valid .netrc file with a secret key from mapbox (with downloads:read rights). Also as I mentioned before I was trying to update mapbox, so I did work perfectly before.

/node_modules/@rnmapbox/maps/rnmapbox-maps.podspec:91: warning: already initialized constant Pod::MapboxImplVersion
/node_modules/@rnmapbox/maps/rnmapbox-maps.podspec:91: warning: previous definition of MapboxImplVersion was here Downloading dependencies
Installing MapboxCommon 23.2.1 (was 22.1.0)

[!] Error installing MapboxCommon
[!] /usr/bin/curl -f -L -o /var/folders/zr/c3cpjz893wz6st4jvbl0kd6m0000gn/T/d20230130-88977-1sk48u/file.zip https://api.mapbox.com/downloads/v2/mapbox-common/releases/ios/packages/23.2.1/MapboxCommon.zip --create-dirs --netrc-optional --retry 2 -A 'CocoaPods/1.11.3 cocoapods-downloader/1.6.3'

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

hi, I meet the same problem, how did you solve it?I read your conversation,but I don’t seem to have found a solution~~~help please!

It is both what @norellanac said and @alimtunc said.

  1. make sure your token has DOWNLOADS:READ scope
  2. vi ~/.netrc and insert the following lines :

machine api.mapbox.com login mapbox password whatever_token_we_have_in_env_for_mapbox

  1. voilà

Be aware also to check if there no additional spaces in password was added, this break all my .netrc thing…

im accomplish with success using this script: open -a TextEdit ~/.netrc

and im found that i have spaces in the password and delete it, and all works well!

when im use: nano ~/.netrc it adding spaces, so be aware

Make sure that your text editor it´s not adding additional strings.

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

`touch ~/.netrc

nano ~/.netrc`

I struggled same issue and I followed bellow link and then it worked to me. https://dev.to/ajmal_hasan/react-native-mapbox-v10-installation-7ga It seems similar with comments from others … anyway it helped me so I recommend you to check it