podfile增加:pod 'SDWebImage/WebP'
然后pod install
pod失败如下:unable to access 'https://chromium.googlesource.com/webm/libwebp/': Failed to connect to chromium.googlesource.com port 443: Operation timed out
操作步骤:
1、 查看 mac 中 cocoapods 本地库路径:
pod repo
2、在本地库中, 并找到对应的 libwebp 版本的文件
find ~/.cocoapods/repos/master -iname libwebp
3、打开上一步查找的路径
open /Users/xxxxxxx/.cocoapods/repos/master/Specs/1/9/2/libwebp
4、在文件下找到之前pod install失败的libwebp版本文件夹
5、打开文件libwebp.podspec.json,修改git的地址
"source": {
"git": "https://chromium.googlesource.com/webm/libwebp",
"tag": "v1.0.2"
},
改为
"source": {
"git": "https://github.com/webmproject/libwebp.git",
"tag": "v1.0.2"
},
保存
6、重新pod install