Flutter-pod repo update无法连接https://github.com/CocoaPods/Specs.git

flutter开发中的iOS版本是通过CocoaPods进行包管理的,类似于android的gradle。如果CocoaPods中的库太老了,编译运行的时候就会报错,提示你更新,报错信息如下:


Error: CocoaPods's specs repository is too out-of-date to satisfy dependencies.
To update the CocoaPods specs, run:
  pod repo update

Error running pod install
Error launching application on iPhone 11.

 

 

所以你在terminal中运行一下命令 pod repo update就可以更新库文件,但是这里有个大坑:

CocoaPods1.8之前的更新source源是

https://github.com/CocoaPods/Specs.git

CocoaPods1.8之后的更新source源改成了:

https://cdn.cocoapods.org/

如果你没有添加这个cdn到你的Podfile文件,更新会一直报错找不到 https://github.com/CocoaPods/Specs.git

所以首先你先运行一下 pod --version查看CocoaPods的版本,如果是大于1.8的版本,要在ios目录下打开Podfile

把source源的地址改一下:

Flutter-pod repo update无法连接https://github.com/CocoaPods/Specs.git

 

看一下官方的说明:

Flutter-pod repo update无法连接https://github.com/CocoaPods/Specs.git

 

Flutter-pod repo update无法连接https://github.com/CocoaPods/Specs.git