flutter编译遇到unknown revision or path not in the working tree的错误

最近在Flutter的开发中,引入了几个第三方包,也就是插件,结果在iOS编译的时候,突然编译不过了,报错信息信息如下:

Updating spec repo `cocoapods`
  $ /usr/local/bin/git -C /Users/zhouxp/.cocoapods/repos/cocoapods fetch origin --progress
  remote: Enumerating objects: 15, done.        
  remote: Counting objects: 100% (15/15), done.        
  remote: Compressing objects: 100% (9/9), done.        
  remote: Total 9 (delta 6), reused 0 (delta 0), pack-reused 0        
  From https://github.com/CocoaPods/Specs
     f8f7414e5953..557c7246c7f2  master     -> origin/master
  $ /usr/local/bin/git -C /Users/zhouxp/.cocoapods/repos/cocoapods rev-parse --abbrev-ref HEAD
  fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree.
  Use '--' to separate paths from revisions, like this:
  'git <command> [<revision>...] -- [<file>...]'
  HEAD
[!] CocoaPods was not able to update the `cocoapods` repo. If this is an unexpected issue and persists you can inspect it running `pod repo update --verbose`

经过一番排查发现,原来是新引入的库使用的一个SDK的版本号和原有库的SDK版本号有冲突,将两者引用的SDK版本号改成一致就好了

打开引入的插件或者项目的ios目录,找到.podspec文件,打开文件,确保各个插件podspec的s.dependency的版本号一致,

否则就会版本冲突的问题。

OK,改好之后重新运行,顺利解决问题

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值