Flutter项目执行pod install/update时BoringSSL-GRPC安装失败求助
Flutter项目中Pod安装BoringSSL-GRPC失败的解决方法
以下是针对你遇到的RPC failed; curl 18 transfer closed错误的可行解决方法:
方法1:切换Git克隆协议为SSH
将GitHub的HTTPS克隆自动替换为SSH协议,避免HTTP连接中断问题:
git config --global url."git@github.com:".insteadOf "https://github.com/"
完成后重新执行pod install或pod update。
方法2:彻底清理缓存后重试
清理所有相关缓存,避免残留的损坏文件影响安装:
- 清理Flutter项目缓存:
flutter clean
- 进入iOS目录,删除Pods文件夹和锁文件:
cd ios rm -rf Pods Podfile.lock
- 清理CocoaPods全局缓存:
pod cache clean --all
- 重新执行安装:
pod install
方法3:手动克隆BoringSSL到本地并指定路径
如果自动克隆始终失败,手动克隆仓库后让Pod使用本地副本:
- 手动克隆BoringSSL到本地稳定路径:
git clone git@github.com:google/boringssl.git ~/local-boringssl
- 在iOS目录的Podfile中添加以下配置,指定BoringSSL的本地源:
pod 'BoringSSL-GRPC', :git => '~/local-boringssl', :tag => '0.0.24'
- 执行
pod install。
方法4:调整Git网络超时参数
延长Git的网络超时时间,避免因网络波动导致的中断:
git config --global http.lowSpeedLimit 0 git config --global http.lowSpeedTime 999999 git config --global core.longpaths true
方法5:升级或指定GRPC版本
BoringSSL-GRPC是GRPC的依赖,尝试升级GRPC版本可能解决版本兼容或源的问题:
在Podfile中添加GRPC的版本指定(替换为最新稳定版):
pod 'gRPC', '~> 1.59.0'
然后执行pod update gRPC。
内容的提问来源于stack exchange,提问作者Wishwell Oklu
相关产品推荐
相关产品推荐

