【问题标题】:Cocoapods error while running ios app which leads error in pod install运行 ios 应用程序时出现 Cocoapods 错误,导致 pod install 出错
【发布时间】:2021-08-23 10:41:45
【问题描述】:

我正在尝试创建 ios 和 android 应用程序,它适用于 android,但对于 ios,在运行 flutter run 时,使用 pod install 安装 pod 将花费大量时间,最后它会给出如下所示的错误.

Error output from CocoaPods:
↳
         Cloning into
         '/var/folders/f6/g4njsx3x5tx5dswcbsh29tdh0000gn/T/d20210605-16785-1rc0t
         ko'...
         fatal: unable to access 'https://github.com/grpc/grpc.git/': Failed to
         connect to github.com port 443: Connection refused
Error running pod install
Error launching application on iPhone 12 Pro Max.

我尝试了这些帖子,但没有运气
error running pod install
error running pod install pods-runner


pubsec.yaml

dependencies:
  flutter:
    sdk: flutter
  cupertino_icons: ^1.0.2
  image_picker: ^0.6.7+17
  firebase_ml_vision: ^0.9.10
  image_cropper: ^1.4.0
  firebase_core: ^0.3.4
  cloud_firestore: ^0.9.13+1
  expandable: ^5.0.1
  web_scraper:

如果需要任何额外信息,请在 cmets 中告诉我

【问题讨论】:

    标签: ios flutter dart cocoapods flutter-dependencies


    【解决方案1】:

    经过大量研究,我找到了解决方案,

    第 1 步:我删除了所有 cocoapods 及其目录

    gem list --local | grep cocoapods
    sudo gem uninstall EACH_OF_THEM  // here EACH_OF_THEM means all the listed cocoapods
    rm -rf ~/.cocoapods
    

    第 2 步:安装 HomeBrew

    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
    

    第 3 步:使用 HomeBrew 安装 cocoapods

    brew install cocoapods
    

    第 4 步:删除 Podfile.lock(如果存在)

    cd ios
    rm Podfile.lock
    

    第 5 步:现在安装 pod

    pod install --repo-update
    

    下载和安装所有依赖项将花费大量时间。

    现在,如果我使用 flutter run 运行颤振项目。成功了

    ...
    Running pod install...
    Running Xcode build...
    ...
    

    参考链接:dev.to

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-05-11
      • 2022-08-23
      • 2017-03-26
      • 2020-10-30
      • 2020-04-12
      • 2017-11-30
      • 1970-01-01
      • 2021-12-14
      相关资源
      最近更新 更多