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 4 years ago
- Reactions: 5
- Comments: 22 (5 by maintainers)
Nothing worked for me. My fix was to be sure that
downloads:readwas selected when creating token.I got solution: Open terminal Type open .netrc Paste following in .netrc file
Save the file and now run pod install
Refer: https://stackoverflow.com/questions/64007478/cocoapods-error-installing-mapbox-ios-sdk
x
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.
machine api.mapbox.com login mapbox password whatever_token_we_have_in_env_for_mapbox
Currently getting this same error right now, with the download:read enabled… I am using Expo
The solution with using .netrc file works. Just make sure that the .netrc file is in your home directory. I was making the mistake of placing the file in my project directory which didn’t work for me.
Ok if you are using expo. You just need to put your secret token as a property in the app.json > plugin:
“plugins”: [ “expo-router”, [ “@rnmapbox/maps”, { “RNMapboxMapsDownloadToken”: “sk.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX”, “RNMapboxMapsVersion”: “11.0.0” } ] ]
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 ~/.netrcand im found that i have spaces in the password and delete it, and all works well!
when im use:
nano ~/.netrcit adding spaces, so be awareMake 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
We are noticing this as well on fresh install, this started happening around Jan 27th. No changes on our end and was working fine before. You can replicate by deleting your pods folder and podfile.lock and attempting pod install.
Error: