Flutter:「pod install」したら、「CocoaPods could not find compatible versions for pod "Firebase/Auth"」のエラー

※当サイトは、アフィリエイト広告を利用しています

結論:「sudo gem install cocoapods」を実行後、「pod install --repo-update」を実行する 

2021/10/31 Flutter エラー・バグ日記

 

「google_mobile_ads」のパッケージを入れた後(これが原因かわからないが、、)、iOS実機で動かすため「pod install」したら、以下のようなエラーが出た。

 

CocoaPods could not find compatible versions forpod "Firebase/Auth":  In snapshot (Podfile.lock):   Firebase/Auth (= 8.5.0)
  In Podfile:    firebase_auth (from `.symlinks/plugins/firebase_auth/ios`) was resolved to 3.0.2, which depends on      Firebase/Auth (= 8.8.0)
Specs satisfying the `Firebase/Auth (= 8.5.0), Firebase/Auth (= 8.8.0)` dependency were found, but they required a higher minimum deployment target.

 

本記事はライトな日記思考で書いているので、詳細説明はしておらず、基本、テキストのみで画像とかは載せておりません。。m(_ _)m

解説記事ではないため、解決していない内容や、その時々の間違った解釈を述べてしまっている可能性が大いにありますので、何卒、ご了承ください。

 

どうやらプロジェクトで使っている「firebase_auth」のバージョンが、「pod install」で入れようとするバージョンと整合しない?ということらしい。

 

特に「firebase_auth」のバージョンは変えておらず、以前は普通に「pod install」できたのに謎。。

 

「pod install」時のエラー対策としていつもやっている、「podfile.lock」の削除「flutter clean」をきちんと実行してから「pod install」しても、エラーは変わらず。

 

調べると、stackoverflowのこちらの記事

 

pod install --repo-update

 

をすると良いとの事だったので、やってみると、こんな感じで最後の1文だけエラーが出た。

 

・・・(略)・・・
Analyzing dependencies
cloud_functions: Using Firebase SDK version '8.8.0' defined in 'firebase_core'
firebase_auth: Using Firebase SDK version '8.8.0' defined in 'firebase_core'
firebase_core: Using Firebase SDK version '8.8.0' defined in 'firebase_core'
[!] GoogleAppMeasurement requires CocoaPods version >= 1.10.2, which is not satisfied by your current version, 1.10.1.

 

どうやら、CocoaPodsのバージョンが古いことが原因っぽい。

 

更に調べてこちらのteratailの記事を参考に、sudo gem install cocoapodsを実行し、その後でもう一度

 

pod install --repo-update

 

を実行したら、

 

・・・(略)・・・
Installing Firebase (8.8.0)
Installing FirebaseAuth (8.8.0)
Installing FirebaseCore (8.8.0)
・・・(略)・・・

 

のように、無事、バージョン8.8.0がインストールされた模様。

 

その後、問題なくiOS実機で実行できた。

 

忘れた頃にまた食らいそうなエラーなので備忘。

 

\一般的なエラー対処法をまとめた記事はこちら/

 

リリースしたアプリ(全てFlutterで開発)

 

個人アプリ開発で役立ったもの

おすすめの学習教材

超初心者向けでオススメな元Udemyの講座/

 

 \キャンペーン時を狙えば安価で網羅的な内容が学べる(日本語訳あり)/

 

\Gitの基礎について無料で学べる/

 

おすすめの学習書籍

実用的image_pickerに関してかなり助けられた/

 

Dartの基礎文法を素早くインプットできる/


Dart入門 - Dartの要点をつかむためのクイックツアー

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