エラーの詳細
FlutterのプロジェクトにFirebaseを追加した際、以下のようなエラーに遭遇しました。
解決方法は記事の一番下に書いてあるので、必要がなければ読み飛ばして下さい。
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 SE (3rd generation).
指示通りに $pod install を実行したところ、今度は別のエラーが発生。
$pod install
...
You have either:
* out-of-date source repos which you can update with `pod repo update` or with `pod install --repo-update`.
* mistyped the name or version.
* not added the source repo that hosts the Podspec to your Podfile.
エラーの指示に従い進めていきます。
$ pod repo update
...
Don't forget to anonymize any private data!
Looking for related issues on cocoapods/cocoapods...
Searching for inspections failed: undefined method `map' for nil:NilClass
同じような状況で苦戦している方がいたので、下記のサイトを参考にさせていただきました。
How to solve: Error updating CocoaPods after upgrading to flutter 3.0.1
どうやらM1Macでは下記の手順で解決できるようです。
解決手順
手順1: FFIのアップデート
任意のディレクトリでFFIをアップデートします。
sudo arch -x86_64 gem install ffi
手順2:プロジェクトのiosフォルダに移動し、podをアップデート
arch -x86_64 pod update
手順3:podのインストール
arch -x86_64 pod install
無事プロジェクトのビルドに成功しました。
ぜひ試してみて下さい。