当前位置: 代码迷 >> 综合 >> pod install时Failed to connect to chromium.googlesource.com
  详细解决方案

pod install时Failed to connect to chromium.googlesource.com

热度:90   发布时间:2024-01-24 17:59:07.0
  1. 查看mac中cocoapods 本地库路径:

 

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 040777master
- Type: git (master)
- URL:  https://github.com/CocoaPods/Specs.git
- Path: /Users/swae/.cocoapods/repos/master
  1. 在本地库中, 并找到对应的libwebp版本的文件

 

swaedeMacBook-Pro:alpface swae$ find ~/.cocoapods/repos/master -iname libwebp

 

/Users/swae/.cocoapods/repos/master/Specs/1/9/2/libwebp

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

 

swaedeMacBook-Pro:libwebp swae$ cd ~/.cocoapods/repos/master/Specs/1/9/2/libwebp
swaedeMacBook-Pro:libwebp swae$ ls -l

 

total 0
drwxr-xr-x  3 swae  staff  96 12  3 21:50 0.4.1
drwxr-xr-x  3 swae  staff  96 12  3 21:50 0.4.2
drwxr-xr-x  3 swae  staff  96 12  3 21:50 0.4.3
drwxr-xr-x  3 swae  staff  96 12  3 21:50 0.4.4
drwxr-xr-x  3 swae  staff  96 12  3 21:50 0.5.0
drwxr-xr-x  3 swae  staff  96 12  3 21:50 0.5.1
drwxr-xr-x  3 swae  staff  96 12  3 21:50 0.5.2
drwxr-xr-x  3 swae  staff  96 12  3 21:50 0.6.0

由于SDWebImage 依赖的 libwebp版本为0.6.0,所以我们进入0.6.0中,并做修改

 

swaedeMacBook-Pro:libwebp swae$ cd 0.6.0/
swaedeMacBook-Pro:0.6.0 swae$ ls -l
total 8
-rw-r--r--@ 1 swae  staff  1587  4 15 09:53 libwebp.podspec.json

在0.6.0目录下的libwebp.podspec.json文件中修改git source

 

swaedeMacBook-Pro:0.6.0 swae$ sudo vim libwebp.podspec.json

找到

 

"source": {
"git": "https://chromium.googlesource.com/webm/libwebp",
"tag": "v0.6.0"
},

将其中的"git" 对应的url替换为https://github.com/webmproject/libwebp.git,并保存
最后再执行pod install, 完成

 

swaedeMacBook-Pro:alpface swae$ pod install

 

/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
Analyzing dependencies
Downloading dependencies
Installing SDWebImage (4.3.3)
Installing libwebp (0.6.0)
Generating Pods project
Integrating client project
Sending stats
Pod installation complete! There are 8 dependencies from the Podfile and 9 total pods installed.
  相关解决方案