pod SDWebImage/WebP
遇到下面的问题
[!] Error installing libwebp
[!] /usr/bin/git clone https://chromium.googlesource.com/webm/libwebp /var/folders/xt/lv4v305j3vq73d84r84db2300000gn/T/d20181030-8624-1jw0he8 --template= --single-branch --depth 1 --branch v1.0.0
Cloning into '/var/folders/xt/lv4v305j3vq73d84r84db2300000gn/T/d20181030-8624-1jw0he8'...
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 解决。
解决流程
- 查看
Mac
中cocoapods
本地库路径:pod repo
Mac-mini:~ ammk$ pod repo
master
- Type: git (master)
- URL: https://github.com/CocoaPods/Specs.git
- Path: /Users/ammk/.cocoapods/repos/master
1 repo
- 在
Path
中找到libwebp
对应的文件夹:find /Users/ammk/.cocoapods/repos/master -iname libwebp
Mac-mini:~ ammk$ find /Users/ammk/.cocoapods/repos/master -iname libwebp
/Users/ammk/.cocoapods/repos/master/Specs/1/9/2/libwebp
Mac-mini:~ ammk$
进入libwebp
目录,查看有哪些版本
Mac-mini:~ ammk$ cd /Users/ammk/.cocoapods/repos/master/Specs/1/9/2/libwebp
Mac-mini:libwebp ammk$ ls -l
total 0
drwxr-xr-x 3 ammk staff 96 4 5 2017 0.4.1
drwxr-xr-x 3 ammk staff 96 4 5 2017 0.4.2
drwxr-xr-x 3 ammk staff 96 4 5 2017 0.4.3
drwxr-xr-x 3 ammk staff 96 4 5 2017 0.4.4
drwxr-xr-x 3 ammk staff 96 4 5 2017 0.5.0
drwxr-xr-x 3 ammk staff 96 4 5 2017 0.5.1
drwxr-xr-x 3 ammk staff 96 8 9 2017 0.5.2
drwxr-xr-x 3 ammk staff 96 8 9 2017 0.6.0
drwxr-xr-x 3 ammk staff 96 10 29 10:06 0.6.1
drwxr-xr-x 3 ammk staff 96 10 30 11:17 1.0.0
在1.0.0
目录下的libwebp.podspec.json
文件中修改git source
Mac-mini:libwebp ammk$ cd 1.0.0
Mac-mini:1.0.0 ammk$ ls -l
total 8
-rw-r--r-- 1 ammk staff 1694 10 30 11:17 libwebp.podspec.json
Mac-mini:1.0.0 ammk$ sudo vim libwebp.podspec.json
将其中homepage
改为https://github.com/webmproject/
,source->git
改为https://github.com/webmproject/libwebp.git
"name": "libwebp",
"version": "1.0.0",
"summary": "Library to encode and decode images in WebP format.",
"homepage": "https://developers.google.com/speed/webp/",
"authors": "Google Inc.",
"license": {
"type": "BSD",
"file": "COPYING"
},
"source": {
"git": "https://chromium.googlesource.com/webm/libwebp",
"tag": "v1.0.0"
},
再cd
到原程序文件下,重新pod install
。
测试 pod
版本:1.5.3