使用CocoaPods安装hermes-engine时遇到报错问题求助
解决brew安装的CocoaPods 1.15.0安装hermes-engine 0.72.6失败的问题
以下是几个实测有效的解决方法,按顺序尝试即可:
清理CocoaPods缓存
旧缓存经常会导致安装异常,先彻底清理:pod cache clean --all rm -rf ~/Library/Caches/CocoaPods rm -rf ./Pods rm Podfile.lock清理完后重新执行
pod install更新CocoaPods源索引
源索引过期也会引发找不到包的问题,更新一下:pod repo update如果默认源访问慢或者出错,换成国内镜像源:
pod repo remove master pod repo add master https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git强制指定hermes-engine的安装源
在Podfile里直接指定对应版本的hermes-engine拉取源,绕开本地索引的问题:
打开Podfile,添加这一行(如果已有hermes-engine的配置就替换掉):pod 'hermes-engine', '0.72.6', :source => 'https://cdn.cocoapods.org/'然后重新执行
pod install切换CocoaPods版本适配
CocoaPods 1.15.0和hermes-engine 0.72.6可能存在兼容性问题,试试降级到1.14.x版本:brew uninstall pod@1.15.0 brew install pod@1.14 brew link --overwrite pod@1.14切换完成后再执行
pod install手动本地安装
要是上面的方法都不管用,就手动操作:- 找到hermes-engine 0.72.6的spec文件(从CocoaPods的spec仓库获取),保存到项目本地的某个目录
- 在Podfile里指定本地路径:
pod 'hermes-engine', :path => './本地spec文件所在路径' - 最后执行
pod install
内容的提问来源于stack exchange,提问作者MShokry
相关产品推荐
相关产品推荐

