Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I keep getting "curl: (22) The requested URL returned error: 401 Unauthorized" when trying to install the pod #2692

Closed
atomicpartyIT opened this issue Oct 13, 2020 · 8 comments
Labels
build Issues related to builds and dependency management. needs more information Can't proceed without more data.

Comments

@atomicpartyIT
Copy link

I have read many tutorials and cannot seem to pin down the issue I do have the .netrt file in the build folder when running and it still reads unauthorized. How do we fix this?

Downloading dependencies
Installing Mapbox-iOS-SDK (6.2.1)

[!] Error installing Mapbox-iOS-SDK
[!] /usr/bin/curl -f -L -o /var/folders/ld/4nl9mlr57jv9ztcy354jzp7w0000gn/T/d20201013-65282-1rdedim/file.zip https://api.mapbox.com/downloads/v2/mobile-maps/releases/ios/packages/6.2.1/mapbox-ios-sdk-dynamic.zip --create-dirs --netrc-optional --retry 2

% 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: 401 Unauthorized

@1ec5
Copy link
Contributor

1ec5 commented Oct 13, 2020

Hi, thanks for taking the navigation SDK for a spin! The .netrc file should be in your home directory (~ on the command line, or use Go ‣ Home in Finder). If it’s located anywhere else, CocoaPods is unable to use it when connecting to the Mapbox Downloads API, so the API returns a 401 error. If you run into any other issues installing the navigation SDK using CocoaPods, this troubleshooting guide has some additional tips.

@1ec5 1ec5 added build Issues related to builds and dependency management. needs more information Can't proceed without more data. labels Oct 13, 2020
@atomicpartyIT
Copy link
Author

atomicpartyIT commented Oct 14, 2020 via email

@atomicpartyIT
Copy link
Author

atomicpartyIT commented Oct 14, 2020

the .netrc file is as follows

"
machine api.mapbox.com
login mapbox
password API Secret Key

"

@atomicpartyIT
Copy link
Author

atomicpartyIT commented Oct 14, 2020

I figured it out, when I was using terminal I was typing
vi .netrc to create the file and it added an extension of .swp at the end so it didn't work. I resolved the issue by entering as follows to create and open the file. Im not sure if this is due to the Mac OS Catalina update or not but we are good to go! Thanks!
% touch .netrc
% open .netrc

@iiasceri
Copy link

.net

Your answer explained it better than their own documentation, thank you spent like stupid 1 hour looking into this

@Beltry201
Copy link

I figured it out, when I was using terminal I was typing
vi .netrc to create the file and it added an extension of .swp at the end so it didn't work. I resolved the issue by entering as follows to create and open the file. Im not sure if this is due to the Mac OS Catalina update or not but we are good to go! Thanks!
% touch .netrc
% open .netrc

Where exactly did you store de .netrc inside the flutter project folder?

@ZumelzuR
Copy link

I figured it out, when I was using terminal I was typing
vi .netrc to create the file and it added an extension of .swp at the end so it didn't work. I resolved the issue by entering as follows to create and open the file. Im not sure if this is due to the Mac OS Catalina update or not but we are good to go! Thanks!
% touch .netrc
% open .netrc

Where exactly did you store de .netrc inside the flutter project folder?

"Your secret token enables you to download the SDK directly from Mapbox. To use your secret token, you will need to store it in a .netrc file in your home directory (not your project folder). This approach helps avoid accidentally exposing your secret token by keeping it out of your application's source code. Depending on your environment, you may have this file already, so check first before creating a new one."

-- https://docs.mapbox.com/ios/maps/guides/install/

Should be in your home folder

@johhansantana
Copy link

johhansantana commented Apr 11, 2023

For anyone wondering where's your home folder or where the file should be exactly plain and simple:

/Users/<your username>/.netrc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Issues related to builds and dependency management. needs more information Can't proceed without more data.
Projects
None yet
Development

No branches or pull requests

6 participants