8
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Flutter 「CocoaPods could not find compatible versions for pod "FirebaseFirestore":」の解決法

Posted at

#FlutterFireのセットアップでつまずく。。。

FlutterでFirebase使おうと公式ドキュメントを見ながらセットアップ。
しかし、ドキュメント通りに進めてもうまいかない場面があった!:unamused:

Improve iOS Build Timesという項目の部分で、

「iOSのビルド時間を短くするためには、下記のコードをios/Podfileに追加してね!」
という内容だ。

# ...
target 'Runner' do
  pod 'FirebaseFirestore', :git => 'https://github.com/invertase/firestore-ios-sdk-frameworks.git', :tag => '6.26.0'
# ...
end

で、公式ドキュメント通りに追加してiOSシュミレーターで実行すると。。。

 Resolving dependencies of `Podfile`
      CDN: trunk Relative path: CocoaPods-version.yml exists! Returning local because checking is only perfomed in repo update
    [!] CocoaPods could not find compatible versions for pod "FirebaseFirestore":
      In snapshot (Podfile.lock):
        FirebaseFirestore (= 7.3.0, ~> 7.3.0)
      In Podfile:
        FirebaseFirestore (from `https://github.com/invertase/firestore-ios-sdk-frameworks.git`, tag `6.26.0`)
    None of your spec sources contain a spec satisfying the dependencies: `FirebaseFirestore (from `https://github.com/invertase/firestore-ios-sdk-frameworks.git`, tag `6.26.0`), FirebaseFirestore (= 7.3.0, ~> 7.3.0)`.

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 12 Pro Max.

こんな感じのエラーが発生(実際のエラーはもっと長文ですw)

#エラーメッセージに記載されてるバージョンに変更してみよう
要するに、ios/Podfileで公式ドキュメント通りに追加したコードで指定してるバージョンが古いようです。

今回私が遭遇したエラーによると**7.3.0**にするべきだと言うことです。。。
と言うわけで、バージョンだけ変更。

ios/Podfile
target 'Runner' do
  use_frameworks!
  use_modular_headers!
  pod 'FirebaseFirestore', :git => 'https://github.com/invertase/firestore-ios-sdk-frameworks.git', :tag => '7.3.0'

  flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end

それからpod install --repo-updateを iOS directoryで実行

これで解決!

8
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
8
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?