Flutter doctorコマンド実行時に「CocoaPods not installed.」のエラーが出力された時の対処法

Flutter
 

環境

macOS Big Sur Version 11.5.2
Flutter 2.2.3
Xcode 12.5.1
CocoaPods 1.10.2

問題と原因

Flutter doctorコマンドを入力した時に以下のようなエラーが発生。

Xcode - develop for iOS and macOS
✗ CocoaPods not installed.
CocoaPods is used to retrieve the iOS and macOS platform side's plugin
code that responds to your plugin usage on the Dart side.
Without CocoaPods, plugins will not work on iOS or macOS.
For more info, see https://flutter.dev/platform-plugins
To install see
CocoaPods Guides
The Dependency Manager for iOS & Mac projects
for instructions.

mac内にCocoaPodsがインストールされていないと怒られている。

CocoaPodsとは

iOSアプリを作るにあたってのパッケージ管理ツールのこと。Webアプリでいうところのnpmみたいなものである。
これをインストールすることで解決されると考えられる。

解決策

sudo gem install cocoapods

基本的にはcocoapodsをインストールすることで解決されるみたい。

flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.2.3, on macOS 11.5.2 20G95 darwin-x64, locale ja-JP)
[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
[✓] Xcode - develop for iOS and macOS
[✓] Chrome - develop for the web
[✓] Android Studio (version 2020.3)
[✓] VS Code (version 1.59.0)
[✓] Connected device (1 available)

解決!

おわり

コメント

タイトルとURLをコピーしました