過去のFlutterプロジェクトを読み込んで実行すると、このようなエラーが出たのですが…
全然意味が分からん…

Launching lib/main.dart on iPhone SE (3rd generation) in debug mode...
Running pod install...
CocoaPods' output:
↳
      Preparing

    Analyzing dependencies

    Inspecting targets to integrate
      Using `ARCHS` setting to build architectures of target `Pods-Runner`: (``)

    Finding Podfile changes
      A FirebaseFirestore
      - Flutter
      - apple_maps_flutter
      - cloud_firestore
      - firebase_core
      - fluttertoast
      - location
      - permission_handler_apple

    Fetching external sources
    -> Pre-downloading: `FirebaseFirestore` from `https://github.com/invertase/firestore-ios-sdk-frameworks.git`, tag `8.14.0`
      > Copying FirebaseFirestore from `/Users/ari526msx/Library/Caches/CocoaPods/Pods/External/FirebaseFirestore/110bacb9177f53067445c5e3b62ac3d2` to `Pods/FirebaseFirestore`
    -> Fetching podspec for `Flutter` from `Flutter`
    -> Fetching podspec for `apple_maps_flutter` from `.symlinks/plugins/apple_maps_flutter/ios`
    -> Fetching podspec for `cloud_firestore` from `.symlinks/plugins/cloud_firestore/ios`
    cloud_firestore: Using Firebase SDK version '8.15.0' defined in 'firebase_core'
    -> Fetching podspec for `firebase_core` from `.symlinks/plugins/firebase_core/ios`
    firebase_core: Using Firebase SDK version '8.15.0' defined in 'firebase_core'
    -> Fetching podspec for `fluttertoast` from `.symlinks/plugins/fluttertoast/ios`
    -> Fetching podspec for `location` from `.symlinks/plugins/location/ios`
    -> Fetching podspec for `permission_handler_apple` from `.symlinks/plugins/permission_handler_apple/ios`

    Resolving dependencies of `Podfile`
      CDN: trunk Relative path: CocoaPods-version.yml exists! Returning local because checking is only performed in repo update
    [!] CocoaPods could not find compatible versions for pod "FirebaseFirestore":
      In snapshot (Podfile.lock):
        FirebaseFirestore (= 8.15.0, ~> 8.15.0)

      In Podfile:
        FirebaseFirestore (from `https://github.com/invertase/firestore-ios-sdk-frameworks.git`, tag `8.14.0`)

    None of your spec sources contain a spec satisfying the dependencies: `FirebaseFirestore (from `https://github.com/invertase/firestore-ios-sdk-frameworks.git`, tag `8.14.0`), FirebaseFirestore (= 8.15.0, ~> 8.15.0)`.

    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.

    /Library/Ruby/Gems/2.6.0/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:317:in `raise_error_unless_state'
    /Library/Ruby/Gems/2.6.0/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:299:in `block in unwind_for_conflict'
    /Library/Ruby/Gems/2.6.0/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:297:in `tap'
    /Library/Ruby/Gems/2.6.0/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:297:in `unwind_for_conflict'
    /Library/Ruby/Gems/2.6.0/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:257:in `process_topmost_state'
    /Library/Ruby/Gems/2.6.0/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:182:in `resolve'
    /Library/Ruby/Gems/2.6.0/gems/molinillo-0.8.0/lib/molinillo/resolver.rb:43:in `resolve'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/resolver.rb:94:in `resolve'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/installer/analyzer.rb:1078:in `block in resolve_dependencies'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/user_interface.rb:64:in `section'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/installer/analyzer.rb:1076:in `resolve_dependencies'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/installer/analyzer.rb:124:in `analyze'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:416:in `analyze'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:241:in `block in resolve_dependencies'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/user_interface.rb:64:in `section'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:240:in `resolve_dependencies'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:161:in `install!'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/command/install.rb:52:in `run'
    /Library/Ruby/Gems/2.6.0/gems/claide-1.1.0/lib/claide/command.rb:334:in `run'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/command.rb:52:in `run'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/bin/pod:55:in `<top (required)>'
    /usr/local/bin/pod:23:in `load'
    /usr/local/bin/pod:23:in `<main>'

Error output from CocoaPods:
↳

    [!] Automatically assigning platform `iOS` with version `12.0` on target `Runner` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.

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).

とにかくFirebaseやFirestore周りで何か見つからないって言っているのですが、対処法が全く思いつきませんでした。

とりあえず最後の方に「Error running pod install」でpod installの実行時エラーのようなことが書いてあったので、「pod install」を実行してみることにしました。

すると次のように表示が出ました。

Analyzing dependencies
Pre-downloading: `FirebaseFirestore` from `https://github.com/invertase/firestore-ios-sdk-frameworks.git`, tag `8.14.0`
cloud_firestore: Using Firebase SDK version '8.15.0' defined in 'firebase_core'
firebase_core: Using Firebase SDK version '8.15.0' defined in 'firebase_core'
[!] CocoaPods could not find compatible versions for pod "FirebaseFirestore":
  In Podfile:
    FirebaseFirestore (from `https://github.com/invertase/firestore-ios-sdk-frameworks.git`, tag `8.14.0`)

    cloud_firestore (from `.symlinks/plugins/cloud_firestore/ios`) was resolved to 3.1.15, which depends on
      Firebase/Firestore (= 8.15.0) was resolved to 8.15.0, which depends on
        FirebaseFirestore (~> 8.15.0)

上記の太字のところに注目して、Podfile内の「FirebaseFirestore・・・」の一文がとにかく上手くいってないということが伝わってきます。

この一文はFlutterでFirebaseを使うときのドキュメントに書かれていたもので、iOSでのビルド時間を短縮するためにPodfileに追記しなさいという指示によって記載したものです。

この一文の意味はよく分かりませんが、何かキャッシュ的なものかなぁと漠然と思っています。

対処法(結果)

Podfileを開いて、この一文の先頭に「#」を入れてコメントアウトしてもう一度ビルドすると、時間はかかりましたが、正常に実行されました。

再度コメントアウトを解除してビルドしてみると、これも正常に実行されました。めでたしめでたし。

About The Author

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です

CAPTCHA