错误信息如下:
[!] Error installing libwebp
[!] /usr/bin/git clone https://chromium.googlesource.com/webm/libwebp /var/folders/yn/3v64_yzx72b0s88w9mx4l7yw0000gn/T/d20200329-51913-egoz06 --template= --single-branch --depth 1 --branch v1.1.0
Cloning into '/var/folders/yn/3v64_yzx72b0s88w9mx4l7yw0000gn/T/d20200329-51913-egoz06'...
fatal: unable to access 'https://chromium.googlesource.com/webm/libwebp/': Failed to connect to chromium.googlesource.com port 443: Operation timed out
解决方法:
1、终端执行 pod repo
查看 cocoapods
在本机的PATH
master
- Type: git (master)
- URL: https://github.com/CocoaPods/Specs.git
- Path: /Users/huipeng/.cocoapods/repos/master
trunk
- Type: CDN
- URL: https://cdn.cocoapods.org/
- Path: /Users/huipeng/.cocoapods/repos/trunk
2、在本地库中, 并找到对应的 libwebp版本
的文件
在 Cocoapods V1.8.0+
中执行以下命令:
find ~/.cocoapods/repos/trunk -iname libwebp
得到路径:
/Users/huipeng/.cocoapods/repos/trunk/Specs/1/9/2/libwebp
-
进入libwebp目录
cd ~/.cocoapods/repos/trunk/Specs/1/9/2/libwebp
-
查看仓库中有哪些对应的版本
ls -l
total 0 drwxr-xr-x 4 huipeng staff 128 Mar 29 20:48 0.4.1 drwxr-xr-x 4 huipeng staff 128 Mar 29 20:48 0.4.2 drwxr-xr-x 4 huipeng staff 128 Mar 29 20:48 0.4.3 drwxr-xr-x 4 huipeng staff 128 Mar 29 20:48 0.4.4 drwxr-xr-x 4 huipeng staff 128 Mar 29 20:48 0.5.0 drwxr-xr-x 4 huipeng staff 128 Mar 29 20:48 0.5.1 drwxr-xr-x 4 huipeng staff 128 Mar 29 20:48 0.5.2 drwxr-xr-x 4 huipeng staff 128 Mar 29 20:48 0.6.0 drwxr-xr-x 4 huipeng staff 128 Mar 29 20:48 0.6.1 drwxr-xr-x 4 huipeng staff 128 Mar 29 20:48 1.0.0 drwxr-xr-x 4 huipeng staff 128 Mar 29 20:48 1.0.1 drwxr-xr-x 4 huipeng staff 128 Mar 29 20:48 1.0.2 drwxr-xr-x 4 huipeng staff 128 Mar 29 20:48 1.0.3 drwxr-xr-x 4 huipeng staff 128 Mar 29 21:12 1.1.0 drwxr-xr-x 4 huipeng staff 128 Mar 29 20:48 1.1.0-rc2
-
根据错误信息,找到对应的版本(
此处是 V1.1.0
),打开文件libwebp.podspec.json
"source": { "git": "https://chromium.googlesource.com/webm/libwebp", "tag": "v1.1.0" },
-
将
"git": "https://chromium.googlesource.com/webm/libwebp",
改成如下地址:"git": "https://github.com/webmproject/libwebp.git",
保存后,再执行
pod update