Flutter: Error running pod install解决

错误信息:

Launching lib/main.dart on iPhone 11 Pro Max in debug mode...Running pod install...CocoaPods' output:↳
      Preparing

    Analyzing dependencies

    Inspecting targets to integrate
      Using `ARCHS` setting to build architectures of target `Pods-Runner`: (``)

    Fetching external sources
    ……这里省略一堆信息,重点在开头和结尾的Error……Error output from CocoaPods:↳
         Cloning into '/var/folders/p_/np5btv6969b2nsyfp68q7_y00000gn/T/d20200218-35172-i852j9'...
         fatal: unable to access 'https://chromium.googlesource.com/webm/libwebp/': Failed to connect to chromium.googlesource.com port 443: Operation timed outError running pod installError launching application on iPhone 11 Pro Max.

这是由于被墙了无法克隆导致的,解决方法提供两个:

一、直接使用代理并全局

二、修改git地址为可访问镜像库

1、进入 libwebp 目录下

cd ~/.cocoapods/repos/trunk/Specs/1/9/2/libwebp/

2、找到最新版本,如上图 1.1.0 并进入

cd 1.1.0

3、编辑 libwebp.podspec.json

vim libwebp.podspec.json

4、修改 git 仓库地址

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

修改成:

"source": {
  "git": "https://github.com/webmproject/libwebp.git",
  "tag": "v1.1.0"}

改完重试下,应该好了!`

(0)

相关推荐