如何通过cocoapods下载Mapbox iOS SDK 6.0和更高版本 [英] How to download Mapbox iOS SDK 6.0 and later w/ cocoapods

查看:193
本文介绍了如何通过cocoapods下载Mapbox iOS SDK 6.0和更高版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试仅将pod文件更改为版本 6.1.0,但最终却出现以下错误:

I tried just changing the pod file to have the version '6.1.0' but it ended up giving the error seen below:

[!]安装Mapbox-iOS-SDK时出错
[!] / usr / bin / curl -f -L -o /var/folders/vn/nddktsy562946cl3l6v3xd740000gn/T/d20200828-4095-1h1x36o/file.zip https://api.mapbox.com/downloads /v2/mobile-maps/releases/ios/packages/6.1.0/mapbox-ios-sdk-dynamic.zip --create-dirs --netrc-optional --retry 2 -A'CocoaPods / 1.9 .3 cocoapods-downloader / 1.4.0'

[!] Error installing Mapbox-iOS-SDK [!] /usr/bin/curl -f -L -o /var/folders/vn/nddktsy562946cl3l6v3xd740000gn/T/d20200828-4095-1h1x36o/file.zip https://api.mapbox.com/downloads/v2/mobile-maps/releases/ios/packages/6.1.0/mapbox-ios-sdk-dynamic.zip --create-dirs --netrc-optional --retry 2 -A 'CocoaPods/1.9.3 cocoapods-downloader/1.4.0'

%接收的总百分比Xferd平均速度时间时间时间时间当前
加载上传的总剩余左手速度
0 44 0 0 0 0 0 0-:-:--:-:--:-:-0
curl:(22)请求的URL返回错误:401

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

然后,我试图(在有限的mapbox文档中看到)在计算机的家中编辑.netrc文件。目录,然后尝试再次运行pod install,但这也无法正常工作。有人这样做吗?谢谢您能提供的任何帮助。

Then I tried to (as seen in the limited mapbox documentation) edit the .netrc file in the computer's home directory and then tried to run pod install again but that also did not work. Anyone do this yet? Thank you for any help you can provide.

推荐答案

从Mapbox版本6开始,您需要授权下载 Maps SDK 和一个带有 Downloads:Read 范围的秘密访问令牌。要创建秘密访问令牌,请遵循此处提到的步骤 https ://docs.mapbox.com/ios/maps/overview/#install-the-maps-sdk 。创建访问令牌后,将访问令牌添加到您的主目录中的 .netrc 文件中

Starting with Mapbox version 6, you will need to authorize your download of the Maps SDK with a secret access token with the Downloads:Read scope. To create a secret access token, follow the steps mentioned here https://docs.mapbox.com/ios/maps/overview/#install-the-maps-sdk. Once created add the access token to your .netrc file in your home directory like this

machine api.mapbox.com 
login mapbox
password <SECRET ACCESS TOKEN>

成功配置 .netrc 文件后,您应该能够使用可可豆荚安装Mapbox sdk

Once the .netrc file is successfully configured, you should be able to install the mapbox sdk using cocoa pods

这篇关于如何通过cocoapods下载Mapbox iOS SDK 6.0和更高版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆