解決pod install报错:unable to access: LibreSSL SSL_read: error:Operation timed out, errno 60

在尝试运行一个新的Flutter项目时,遇到了iOS构建错误,原因是CocoaPods在安装protobuf依赖时网络超时。解决方案是配置命令行代理,确保可以从GitHub下载库。通过在环境变量中设置http和https代理,然后重新运行`flutterrun`,成功执行了podinstall并解决了问题。

出现场景

新电脑运行一个老Flutter项目,flutter run运行ios出现以下报错。

Launching lib/main.dart on iPhone in debug mode...
Upgrading AppFrameworkInfo.plist
Upgrading Podfile
Updating project for Xcode compatibility.
Upgrading project.pbxproj
Upgrading Runner.xcscheme
Upgrading Info.plist
Removing script build phase dependency analysis.
Automatically signing iOS for device deployment using specified development team in Xcode project: YE6STNG83Y
Running pod install...
CocoaPods' output:
↳
      Preparing

    Analyzing dependencies

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

    Finding Podfile changes
      - Flutter
      - device_info
      - flutter_compass
      - flutter_reactive_ble
      - fluttertoast
      - location_permissions
      - shared_preferences

    Fetching external sources
    -> Fetching podspec for `Flutter` from `Flutter`
    -> Fetching podspec for `device_info` from `.symlinks/plugins/device_info/ios`
    -> Fetching podspec for `flutter_compass` from `.symlinks/plugins/flutter_compass/ios`
    -> Fetching podspec for `flutter_reactive_ble` from `.symlinks/plugins/flutter_reactive_ble/ios`
    -> Fetching podspec for `fluttertoast` from `.symlinks/plugins/fluttertoast/ios`
    -> Fetching podspec for `location_permissions` from `.symlinks/plugins/location_permissions/ios`
    -> Fetching podspec for `shared_preferences` from `.symlinks/plugins/shared_preferences/ios`

    Resolving dependencies of `Podfile`
      CDN: trunk Relative path: CocoaPods-version.yml exists! Returning local because checking is only performed in repo update
      CDN: trunk Relative path: all_pods_versions_e_c_d.txt exists! Returning local because checking is only performed in repo update
      CDN: trunk Relative path: Specs/e/c/d/Protobuf/3.23.1/Protobuf.podspec.json exists! Returning local because checking is only performed in repo update
      CDN: trunk Relative path: all_pods_versions_4_a_9.txt exists! Returning local because checking is only performed in repo update
      CDN: trunk Relative path: Specs/4/a/9/SwiftProtobuf/1.21.0/SwiftProtobuf.podspec.json exists! Returning local because checking is only performed in repo update
      CDN: trunk Relative path downloaded: all_pods_versions_5_1_0.txt, save ETag: W/"647d3427-442"
      CDN: trunk Redirecting from https://cdn.cocoapods.org/Specs/5/1/0/Toast/2.0/Toast.podspec.json to https://cdn.jsdelivr.net/cocoa/Specs/5/1/0/Toast/2.0/Toast.podspec.json
      CDN: trunk Redirecting from https://cdn.cocoapods.org/Specs/5/1/0/Toast/2.1/Toast.podspec.json to https://cdn.jsdelivr.net/cocoa/Specs/5/1/0/Toast/2.1/Toast.podspec.json
      CDN: trunk Redirecting from https://cdn.cocoapods.org/Specs/5/1/0/Toast/2.2/Toast.podspec.json to https://cdn.jsdelivr.net/cocoa/Specs/5/1/0/Toast/2.2/Toast.podspec.j
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值