[!] Error installing libwebp

pod 安装或者更新库出现

[!] Error installing libwebp

[!] /usr/bin/git clone https://chromium.googlesource.com/webm/libwebp /var/folders/gx/b9_gbn2d2rb1h5vjh8k6rqgc0000gp/T/d20200509-11525-1o6z5io --template= --single-branch --depth 1 --branch v1.1.0

Cloning into '/var/folders/gx/b9_gbn2d2rb1h5vjh8k6rqgc0000gp/T/d20200509-11525-1o6z5io'...

fatal: unable to access 'https://chromium.googlesource.com/webm/libwebp/': Failed to connect to chromium.googlesource.com port 443: Operation timed out

的问题

解决办法:

修改pod repo中libwebp的git source 地址,再执行pod install 解决,

但是我们需要有一个有效的libwebp的git仓库,在github上找到了一个https://github.com/webmproject/libwebp.git,可以看到mirrored from https://chromium.googlesource.com/webm/libwebp。

下面是步骤:

查看mac中cocoapods 本地库路径:

$ pod repo

执行的结果:

aliyun

- Type: git (master)

- URL:  https://github.com/aliyun/aliyun-specs.git

- Path: /Users/admin/.cocoapods/repos/aliyun

master

- Type: git (master)

- URL:  https://github.com/CocoaPods/Specs.git

- Path: /Users/admin/.cocoapods/repos/master

在本地库中, 并找到对应的libwebp版本的文件:

$/Users/设备名称/.cocoapods/repos/master -iname libwebp

执行结果:/Users/设备名称/.cocoapods/repos/master/Specs/1/9/2/libwebp

进入libwebp目录,可以看到你的仓库中有哪些对应的版本

化繁为简,直接进入到/Users/swae/.cocoapods/repos/master/Specs/1/9/2/libwebp里打开文件libwebp.podspec.json,修改git的地址就可以了

重新执行pod install 或者 pod update 就可以了。

你可能感兴趣的:([!] Error installing libwebp)