Flutter CocoaPods not installed 和修改清华源

发布时间 2023-10-30 16:52:12作者: vx_guanchaoguo0

mac M2使用 flutter 文件 path_provider 的出现

Warning: CocoaPods is installed but broken. Skipping pod install.
You appear to have CocoaPods installed but it is not working.
This can happen if the version of Ruby that CocoaPods was installed with is different from the one being used to invoke it.
This can usually be fixed by re-installing CocoaPods.
To re-install see https://guides.cocoapods.org/using/getting-started.html#installation for instructions.

CocoaPods not installed or not in valid state.

安装 CocoaPods

arch -arm64 brew install cocoapods

执行安装

# 进入目录
cd $project/macos

#  在 Podfile 文件开头加入
source 'https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git'

# 执行安装
cd Runner
pod repo remove trunk
pod install