You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Flutter iOS构建执行pod install时BoringSSL-GRPC安装报错求助

解决Flutter iOS构建中pod install的BoringSSL-GRPC gunzip错误

核心原因

报错里的gunzip: unknown compression format是因为CocoaPods缓存的BoringSSL-GRPC压缩包损坏,导致解压失败。

解决步骤

  1. 清理CocoaPods缓存
    直接清理所有缓存(或者单独清理BoringSSL-GRPC缓存):

    # 清理所有pod缓存
    pod cache clean --all
    # 或仅清理BoringSSL-GRPC缓存
    pod cache clean BoringSSL-GRPC
    
  2. 清理Flutter和iOS项目残留文件

    flutter clean
    rm -rf ios/Pods ios/Podfile.lock ios/Runner.xcworkspace
    
  3. 重新获取依赖并执行pod安装

    flutter pub get
    cd ios
    pod install --repo-update
    

额外优化建议

  • 不要手动在Podfile中添加Firebase依赖:Flutter的Firebase集成应该通过pubspec.yaml引入官方插件(比如firebase_core、cloud_firestore、firebase_auth),由Flutter自动管理Pod依赖,避免版本不兼容。示例pubspec.yaml配置:

    dependencies:
      flutter:
        sdk: flutter
      firebase_core: ^2.15.0
      cloud_firestore: ^4.8.3
      firebase_auth: ^4.7.2
    
  • 改用静态框架链接:在Podfile中修改use_frameworks!为静态链接,适配Firebase最新要求:

    platform :ios, '13.0'
    
    target 'Runner' do
      use_frameworks! :linkage => :static
      use_modular_headers!
    
      flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
    end
    
  • 检查Xcode命令行工具:确保Xcode命令行工具是最新版本:

    xcode-select --install
    

内容的提问来源于stack exchange,提问作者Kris Py

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.22 16:13:27