Flutter iOS构建执行pod install时BoringSSL-GRPC安装报错求助
解决Flutter iOS构建中
pod install的BoringSSL-GRPC gunzip错误 核心原因
报错里的gunzip: unknown compression format是因为CocoaPods缓存的BoringSSL-GRPC压缩包损坏,导致解压失败。
解决步骤
清理CocoaPods缓存
直接清理所有缓存(或者单独清理BoringSSL-GRPC缓存):# 清理所有pod缓存 pod cache clean --all # 或仅清理BoringSSL-GRPC缓存 pod cache clean BoringSSL-GRPC清理Flutter和iOS项目残留文件
flutter clean rm -rf ios/Pods ios/Podfile.lock ios/Runner.xcworkspace重新获取依赖并执行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
相关产品推荐
相关产品推荐

