最近在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,改好之后重新运行,顺利解决问题