构建Flutter应用时遇pod install错误:BoringSSL-GRPC安装失败
解决Flutter pod install时BoringSSL-GRPC克隆失败的问题
错误信息:
[!] Error installing BoringSSL-GRPC [!] /usr/bin/git clone https://github.com/google/boringssl.git /var/folders/tm/64d5mqbn3wb9kfg7rx4t0vrh0000gp/T/d20231208-2941-1ub811p --template= Cloning into '/var/folders/tm/64d5mqbn3wb9kfg7rx4t0vrh0000gp/T/d20231208-2941-1ub811p'... error: RPC failed; curl 18 HTTP/2 stream 5 was reset error: 4614 bytes of body are still expected fetch-pack: unexpected disconnect while reading sideband packet fatal: early EOF fatal: fetch-pack: invalid index-pack output
执行pod install过程中克隆BoringSSL-GRPC仓库失败,出现RPC错误、HTTP/2流重置等问题,可按以下方法解决:
调整Git网络配置
增大Git的HTTP缓存并切换到HTTP/1.1,避免HTTP/2的流重置问题:git config --global http.postBuffer 524288000 git config --global http.version HTTP/1.1配置完成后重新运行
pod install。手动克隆仓库到Pod缓存目录
- 创建CocoaPods的BoringSSL-GRPC缓存目录(如果不存在):
mkdir -p ~/Library/Caches/CocoaPods/Pods/External/BoringSSL-GRPC - 手动克隆仓库到该目录:
git clone https://github.com/google/boringssl.git ~/Library/Caches/CocoaPods/Pods/External/BoringSSL-GRPC - 返回Flutter项目目录,再次执行
pod install。
- 创建CocoaPods的BoringSSL-GRPC缓存目录(如果不存在):
清理Pod缓存后重试
- 清除所有本地Pod缓存:
pod cache clean --all - 删除项目下的
Pods目录和Podfile.lock文件:rm -rf Pods Podfile.lock - 重新执行
pod install。
- 清除所有本地Pod缓存:
切换仓库源(网络环境受限场景)
如果无法访问GitHub,可在项目的Podfile中替换BoringSSL-GRPC的源为镜像仓库:source 'https://cdn.cocoapods.org/' pod 'BoringSSL-GRPC', :git => 'https://gitee.com/mirrors/boringssl.git'保存后执行
pod install。
内容的提问来源于stack exchange,提问作者Armagan GOK
相关产品推荐
相关产品推荐

