CocoaPods 添加WebP失败解决办法

 pod 'sdwebimage/webp' 下载libwebp 超时

 

[!] Error installing libwebp
[!] /usr/bin/git clone https://chromium.googlesource.com/webm/libwebp /var/folders/p6/t42f8nmd7332018zm9m2s3d80000gn/T/d20180415-42656-1hjxh43 --template= --single-branch --depth 1 --branch v0.6.0

Cloning into '/var/folders/p6/t42f8nmd7332018zm9m2s3d80000gn/T/d20180415-42656-1hjxh43'...
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. 查看mac中cocoapods 本地库路径:
swaedeMacBook-Pro:alpface swae$ pod repo
swaedeMacBook-Pro:alpface swae$ pod repo
/Users/swae/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/cocoapods-1.4.0/lib/cocoapods/executable.rb:89: warning: Insecure world writable dir /opt in PATH, mode 040777 master - Type: git (master) - URL: https://github.com/CocoaPods/Specs.git - Path: /Users/swae/.cocoapods/repos/master 
  1. 在本地库中, 并找到对应的libwebp版本的文件
swaedeMacBook-Pro:alpface swae$ find /Users/swae/.cocoapods/repos/master -iname libwebp
/Users/swae/.cocoapods/repos/master/Specs/1/9/2/libwebp 

进入libwebp目录,可以看到你的仓库中有哪些对应的版本

化繁为简,直接进入到/Users/swae/.cocoapods/repos/master/Specs/1/9/2/libwebp里打开文件libwebp.podspec.json,修改git的地址就可以了

转载于:https://www.cnblogs.com/junhuawang/p/9541406.html

你可能感兴趣的:(CocoaPods 添加WebP失败解决办法)