pod install libwebp遇到的坑
程序员文章站
2022-03-09 20:08:14
...
cocoapods使用过程中遇到的坑–pod install libwebp
1.拉取一些库失败例如libwebp
问题描述:
使用pod install libwebp的时候报错
Installing libwebp 1.1.0 (source changed to `https://github.com/CocoaPods/Specs.git` from `trunk`)
[!] Error installing libwebp
[!] /usr/bin/git clone https://chromium.googlesource.com/webm/libwebp /var/folders/zl/014s9t8x7n90s8thffl59zx40000gn/T/d20200501-22265-1fe2ab5 --template= --single-branch --depth 1 --branch v1.1.0
Cloning into '/var/folders/zl/014s9t8x7n90s8thffl59zx40000gn/T/d20200501-22265-1fe2ab5'...
fatal: unable to access 'https://chromium.googlesource.com/webm/libwebp/': LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to chromium.googlesource.com:443
问题原因:
主要是国内去拉谷歌的源,会非常慢导致失败,所以需要修改podspec.json切换源路径到GitHub
解决办法:
找到本地的对应库的podspec.json文件,然后修改对应的source
步骤:
**1.find /Users/电脑机器名***/.cocoapods/repos -iname libwebp**
出现如下展示:
/Users/x***/.cocoapods/repos/master/Specs/1/9/2/libwebp
/Users/x***/.cocoapods/repos/cocoapods/Specs/1/9/2/libwebp
/Users/x***/.cocoapods/repos/trunk/Specs/1/9/2/libwebp
**2.执行下面的操作打开对应的三方库**
open /Users/xiazhengcheng/.cocoapods/repos/cocoapods/Specs/1/9/2/libwebp
如下图展示,然后找到对应的版本,修改文件的podspec.json里面的source
![在这里插入图片描述](https://img-blog.csdnimg.cn/69118e6139064f56a430649c51f54ee0.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3hpYXpoZW5nY2hlbmc=,size_16,color_FFFFFF,t_70#pic_center)
**3.打开文件**
找下下面的source
"source": {
"git": "https://chromium.googlesource.com/webm/libwebp",
"tag": "v1.1.0"
},
**4.将这里的git链接改成 https://github.com/webmproject/libwebp.git 并保存,这个路径是这个库在github上对应的路径。**
然后在pod install就应该可以了。