【Flutter】#import <cloud_firestore/CloudFirestorePlugin.h>がError部として出力されるケースの処置
症状
MyMacBookAir:traveling_jirorian_problem_flutter swchrm$ flutter run Launching lib/main.dart on {hogehoge} の iPhone in debug mode... Automatically signing iOS for device deployment using specified development team in Xcode project: 7L3X9G2952 Starting Xcode build... ├─Assembling Flutter resources... 3.5s └─Compiling, linking and signing... 1.1s Xcode build done. 8.2s Failed to build iOS app Error output from Xcode build: ↳ ** BUILD FAILED ** Xcode's output: ↳ /Users/swchrm/Documents/MyProject/traveling_jirorian_problem_flutter/ios/Runner/GeneratedPluginRegistrant.m:6:9: fatal error: 'cloud_firestore/CloudFirestorePlugin.h' file not found #import <cloud_firestore/CloudFirestorePlugin.h> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1 error generated. Could not build the precompiled application for the device. Error launching application on {hogehoge} の iPhone. 3.6s
原因
flutter run
を実行する中でpod install
をしてくれるにもかかわらず、別でpod install
を行ってしまっていた。
これにより、flutter run
時にすでにPodfile(もしくはPodfile.lock)ができてしまい、flutter run
時のpod install
でインストールされるはずのFirestoreのプラグインが入らなかった。
対処法
一度Podfile、Podfile.lock、Podsを削除して、flutter run
でpod install
を行う。