Error installing libwebp iOS使用cocoapods 安装libwebp 0.6.0(或其他版本)遇到

Error installing libwebp iOS使用cocoapods 安装libwebp 0.6.0(或其他版本)遇到

超时问题:

Installing libwebp 1.0.0 (source changed to `https://cdn.cocoapods.org/` from `https://github.com/cocoapods/specs.git`)

[!] Error installing libwebp
[!] /usr/bin/git clone https://chromium.googlesource.com/webm/libwebp /var/folders/m5/vqf9jyl118d7jpm05834xt980000gn/T/d20200403-43958-kdw5rq --template= --single-branch --depth 1 --branch v1.0.0

Cloning into '/var/folders/m5/vqf9jyl118d7jpm05834xt980000gn/T/d20200403-43958-kdw5rq'...
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

,而且正好有我需要的版本1.0.0, 那么我就替换为这个。

步骤

查看mac中cocoapods 本地库路径

pod repo
trunk
- Type: CDN
- URL:  https://cdn.cocoapods.org/
- Path: /Users/yangjunxia/.cocoapods/repos/trunk

1 repo

找到本地库对应的libwebp版本的文件

~/.cocoapods/repos/trunk -iname libwebp
/Users/yangjunxia/.cocoapods/repos/trunk/Specs/1/9/2/libwebp

进入libwebp目录

cd /Users/yangjunxia/.cocoapods/repos/trunk/Specs/1/9/2/libwebp

版本

ls -l

进入libwebp对应的版本

cd 1.0.0

在该版本目录下的libwebp.podspec.json文件中修改git source

sudo vim libwebp.podspec.json

找到
source

git地址改为

 https://github.com/webmproject/libwebp.git

保存

就可以正常执行install等代码啦

原文

你可能感兴趣的:(第三方)