0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

CocoaPods could not find compatible versions for pod "FirebaseCoreExtension":を解決する

Posted at

はじめに

FlutterでFirestoreを使うときに必ずと言っていいほどぶつかるのが、ビルドが長すぎる問題である。

このように多くの人がfirestore-ios-sdk-frameworksを導入していると思われる。

この記事はfirestore-ios-sdk-frameworks導入時に発生したエラーの解決までも道のりである。

何か依存関係のエラー起きる

ios/Podfile
target 'Runner' do
  use_frameworks!
  use_modular_headers!

  pod 'FirebaseFirestore', :git => 'https://github.com/invertase/firestore-ios-sdk-frameworks.git', :tag => '11.2.0'
  flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
  target 'RunnerTests' do
    inherit! :search_paths
  end
end

このようにfirestore-ios-sdk-frameworksを取得するようにしました。
pod install --repo-updateで各ライブラリの情報(バージョン、依存関係など)を更新した上でinstall

しかし、、、エラーになりました。。

 $ pod install --repo-update                                                       (git)-[master]
Updating local specs repositories
Analyzing dependencies
Pre-downloading: `FirebaseFirestore` from `https://github.com/invertase/firestore-ios-sdk-frameworks.git`, tag `11.2.0`
cloud_firestore: Using Firebase SDK version '11.2.0' defined in 'firebase_core'
firebase_auth: Using Firebase SDK version '11.2.0' defined in 'firebase_core'
firebase_core: Using Firebase SDK version '11.2.0' defined in 'firebase_core'
[!] CocoaPods could not find compatible versions for pod "FirebaseCoreExtension":
  In snapshot (Podfile.lock):
    FirebaseCoreExtension (= 11.3.0, ~> 11.0)

  In Podfile:
    FirebaseCoreExtension (~> 11.3.0)

    FirebaseFirestore (from `https://github.com/invertase/firestore-ios-sdk-frameworks.git`, tag `11.2.0`) was resolved to 11.2.0, which depends on
      FirebaseFirestoreBinary (= 11.2.0) was resolved to 11.2.0, which depends on
        FirebaseCoreExtension (= 11.2.0)

なんでや?

pubspec.yaml
dev_dependencies:
  flutter_test:
    sdk: flutter

  firebase_core: ^3.6.0
  firebase_auth: ^5.3.1
  cloud_firestore: ^5.4.4

firebase_core^3.6.0
iOS SDK をバージョン 11.2.0 にアップデートされているはず。。

Screenshot 2024-10-07 at 12.47.45.png

謎である。

FirebaseCoreExtensionもバージョン指定

ios/Podfile
target 'Runner' do
  use_frameworks!
  use_modular_headers!

  pod 'FirebaseCoreExtension', '~> 11.2.0'
  pod 'FirebaseFirestore', :git => 'https://github.com/invertase/firestore-ios-sdk-frameworks.git', :tag => '11.2.0'
  flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
  target 'RunnerTests' do
    inherit! :search_paths
  end
end

FirebaseCoreExtension~> 11.2.0でバージョンを直接

rm Podfile.lock

Podfile.lockを削除

pod install --repo-update

再度インストール

これで無事直りました!!

"Keep Xcode Version" vs. "Use Version on Disk"

インストールが成功すると、以下のような問いかけが出ることがあるかと

Screenshot 2024-10-07 at 14.09.20.png

Xcodeで開いているプロジェクトファイル(Runner.xcworkspace)が他のアプリケーション(ここではCocoaPodsコマンド)によって変更されたために発生しています。

CocoaPodsのpod installpod updateを実行した直後にこのメッセージが出た場合、CocoaPodsによって更新された内容(ディスク上のファイル)を反映させたいのでUse Version on Diskを選択しましょう

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?