问题:
运行出现以下报错
Launching lib/main.dart on macOS in debug mode... Warning: CocoaPods not installed. Skipping pod install. CocoaPods is a package manager for iOS or macOS platform code. Without CocoaPods, plugins will not work on iOS or macOS. For more info, see Using packages | Flutter For installation instructions, see CocoaPods Guides - Getting Started Error: CocoaPods not installed or not in valid state.
提示:应该是CocoaPods安装有问题
步骤:
1.先卸载所有的CocoaPods
(1)查看 gem list cocoapods 或者
gem list | grep cocoapods
或者which -a pod
或者
(2)卸载方式
brew uninstall cocoapods
或者
sudo gem uninstall cocoapods
或者
sudo rm -rf /usr/local/opt/ruby/bin/pod
或者
sudo rm -rf /usr/local/bin/pod
直到 which -a pod 为空
2.安装
sudo gem install -n /usr/local/bin cocoapods
pod setup
pod --version