[!] Error installing FBAudienceNetwork
[!] /usr/bin/curl -f -L -o /var/folders/7_/93fdwgls75b33ffchc62lg1h0000gn/T/d20260703-20118-uoyv6j/file.zip https://developers.facebook.com/resources/FBAudienceNetwork-6.20.1.zip --create-dirs --netrc-optional --retry 2 -A 'CocoaPods/1.16.2 cocoapods-downloader/2.1'

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:--  0:01:15 --:--:--     0
curl: (28) Failed to connect to developers.facebook.com port 443 after 75004 ms: Couldn't connect to server
Warning: Problem : timeout. Will retry in 1 seconds. 2 retries left.
  0     0    0     0    0     0      0      0 --:--:--  0:01:15 --:--:--     0
curl: (28) Failed to connect to developers.facebook.com port 443 after 75012 ms: Couldn't connect to server
Warning: Problem : timeout. Will retry in 2 seconds. 1 retries left.
  0     0    0     0    0     0      0      0 --:--:--  0:01:18 --:--:--     0
curl: (28) Failed to connect to developers.facebook.com port 443 after 78128 ms: Couldn't connect to server

这段字符串是 ‌CocoaPods‌ 在下载依赖时底层调用 curl 命令的参数片段,通常出现在 pod install 或 pod update 的报错日志中。它本身不是可独立执行的完整命令,而是表示下载过程因网络问题(如连接超时、SSL 错误)中断。‌‌

核心含义解析

  • --create-dirs‌:自动创建保存文件所需的目录。
  • --netrc-optional‌:可选地使用 ~/.netrc 文件中的认证信息。
  • --retry 2‌:下载失败后重试 2 次。
  • -A 'CocoaPods/1.16.2...'‌:设置 HTTP User-Agent,标识请求来源为 CocoaPods 及其插件版本。

常见触发场景与解决方案

若你在日志中看到此段且伴随 curl 错误(如 Connection refusedSSL certificate problem),请按以下顺序排查:

  1. 检查网络连通性
    GitHub 资源(如 raw.githubusercontent.com)在国内可能访问不稳定。尝试切换网络环境(如手机热点)或配置代理:

    
      

    bash

    export https_proxy=http://127.0.0.1:端口号 
    
    pod install --verbose

  2. 忽略 SSL 验证(仅限临时调试)
    在终端执行:

    
      

    bash

    echo insecure >> ~/.curlrc

    随后重新运行 pod install。注意:此操作会降低安全性,生产环境慎用。‌‌

  3. 更新 CocoaPods 及插件
    你使用的版本 1.16.2 较新,确保 cocoapods-downloader 也兼容:

    bash

    sudo gem install cocoapods pod repo update

  4. 手动清理缓存
    删除 Pods 目录和锁文件后重试:

    
      

    bash

    rm -rf Pods Podfile.lock . Pods.xcworkspace pod install

Logo

汇聚全球AI编程工具,助力开发者即刻编程。

更多推荐