[iOS]cocoapods安装libwebp失败问题

由于libwebp的源在google上,即使全局翻墙也无济于事,猜想是因为pod内部的代理机制不走自己的ss,于是参考了一下方法。

找一个国内镜像,替换掉libwebp的源,找到的国内镜像在https://github.com/webmproject/libwebp.git

  1. 查看pod本地库路径:pod repo
  2. 查找libwebp的记录路径:find ~/.cocoapods/repos/master -iname libwebp
  3. 进入libwebp的记录路径:cd /Users/lijinhai/.cocoapods/repos/master/Specs/1/9/2/libwebp
  4. 修改文件1.0.0/libwebp.podspec.json,修改其中的
1
2
3
4
"source": {
"git": "https://chromium.googlesource.com/webm/libwebp",
"tag": "v1.0.0"
},

改为:

1
2
3
4
"source": {
"git": "https://github.com/webmproject/libwebp.git",
"tag": "v1.0.0"
},
  1. 最后在项目中执行pod installpod update即可

(•̀ᴗ•́)و ̑̑

Share