本文由动哒公众号(dongda_5g),QQ群(58621899)提供,欢迎关注获取技术支持,有任何问题群里都会回复。

在Flutter开发过程中,经常会遇到如下报错:

    /Users/administrator/.gem/ruby/2.7.0/gems/cocoapods-1.9.3/lib/cocoapods/downloader/cache.rb:100: warning: Using the last argument as
    keyword parameters is deprecated; maybe ** should be added to the call
    /Users/administrator/.gem/ruby/2.7.0/gems/cocoapods-1.9.3/lib/cocoapods/downloader/request.rb:61: warning: The called method `slug' is
    defined here
         Cloning into '/var/folders/8_/3x44yhn96q5bz08k29q8hw_c0000gn/T/d20200828-1119-1ykeec9'...
         fatal: unable to access 'https://chromium.googlesource.com/webm/libwebp/': Failed to connect to chromium.googlesource.com port
         443: Operation timed out

    [!] 'AMapSearch' uses the unencrypted 'http' protocol to transfer the Pod. Please be sure you're in a safe network with only trusted
    hosts. Otherwise, please reach out to the library author to notify them of this security issue.

    [!] 'MOBFoundation' uses the unencrypted 'http' protocol to transfer the Pod. Please be sure you're in a safe network with only trusted
    hosts. Otherwise, please reach out to the library author to notify them of this security issue.

访问不到 fatal: unable to access ‘https://chromium.googlesource.com/webm/libwebp/’: Failed to connect to chromium.googlesource.com port
443: Operation timed out

因为googlesource.com是国外的网站,因此访问不到。

进入/Users/administrator/.cocoapods/repos/trunk/Specs/1/9/2/libwebp目录,我是cocoapods 1.9.2,注意跟路径对应。

找到最新版本

AdministratordeMacBook-Air:libwebp administrator$ ls
0.4.1		0.4.4		0.5.2		1.0.0		1.0.3
0.4.2		0.5.0		0.6.0		1.0.1		1.1.0
0.4.3		0.5.1		0.6.1		1.0.2		1.1.0-rc2
AdministratordeMacBook-Air:libwebp administrator$ cd 1.1.0
AdministratordeMacBook-Air:1.1.0 administrator$ ls
libwebp.podspec.json		libwebp.podspec.json.etag
AdministratordeMacBook-Air:1.1.0 administrator$ 

把https://chromium.googlesource.com/webm/libwebp 替换为 https://github.com/webmproject/libwebp.git 并保存。
修改之前为:
在这里插入图片描述

修改之后为:
在这里插入图片描述

Logo

开源鸿蒙跨平台开发社区汇聚开发者与厂商,共建“一次开发,多端部署”的开源生态,致力于降低跨端开发门槛,推动万物智联创新。

更多推荐