# 【1分で解決】CocoaPods could not find compatible versionsエラー

> pod installエラー「CocoaPods could not find compatible versions」解決方法。Flutter iOSでffi（CocoaPodsの一部であるRuby gemsの依存パッケージ）をインストールすることで内部でエラー解消します。

- 公開日: 2025-07-23
- 著者: Matsu
- タグ: Flutter
- URL: https://tech.anycloud.co.jp/articles/cocoapods-could-not-find-compatible-versions

---

## flutter runやpod installでFirebase/CoreOnlyエラー

`flutter run` or `pod install`すると以下のエラーが出てビルドできない…

`Firebase/CoreOnly` バージョンが CocoaPods の spec リポジトリに存在しない、つまり手元のポッドのリポジトリが古くて必要なバージョンを見つけられないというエラーです。

```plaintext
% pod install
....
[!] CocoaPods could not find compatible versions for pod "Firebase/CoreOnly":
  In snapshot (Podfile.lock):
    Firebase/CoreOnly (= 11.10.0)

  In Podfile:
    firebase_core (from `.symlinks/plugins/firebase_core/ios`) was resolved to 3.15.2, which depends on
      Firebase/CoreOnly (= 11.15.0)

You have either:
 * out-of-date source repos which you can update with `pod repo update` or with `pod install --repo-update`.
 * changed the constraints of dependency `Firebase/CoreOnly` inside your development pod `firebase_core`.
   You should run `pod update Firebase/CoreOnly` to apply changes you've made.
```

## 解決方法

iosディレクトリで以下を実行して解消。

```plaintext
% sudo arch -x86_64 gem install ffi
% rm -rf Podfile.lock
% arch -x86_64 pod repo update
% arch -x86_64 pod install
```

`ffi` は CocoaPods の一部である Ruby gems の依存パッケージです。

これが正しく動いていないと CocoaPods が内部でエラーを出す可能性があります。

特に M1/M2 環境では `ffi` のネイティブビルドが ARM だと CocoaPods と不整合を起こす場合があり、それを避けるために `x86_64` でインストールします。
