'Module 'cloud_firestore' not found: Flutter on BigSur VM

Before trying to mark this question as a duplicate, hear me out. I've successfully implemented firebase into my flutter project on Android, Windows (Android Studio). The next step was to test it on a physical device (iPhone) so I did the following:

  1. cloned repository from GitHub onto my mac (BigSur virtual machine)
  2. used: flutter pub get (for dependencies)
  3. used: open Runner.xcworkspace and configured it accordingly (connected iPhone, added team, certificates, etc)
  4. Added the GoogleService-Info.plist into Runner folder
  5. Run the app, resulting in: fatal error: module 'cloud_firestore' not found

The app worked on my phone prior to the implementation of firebase. From what I've read online, Flutter automatically generates pod files, but I have no such file(s) in my iOS folder, which is odd as I added firebase dependencies to the yaml file (and ran flutter pub get), so a pod file should be generated. On the other hand, creating pod files manually resulted in 3 additional errors (including the current one) and 2 warnings, which seemed counter-intuitive.

I cant update any deployment targets since the pod file is not there (and creating an empty one creates more issues). Also tried deleting the ios folder and 'flutter create .' which creates the folder without podfile(s).

Any help is appreciated.



Solution 1:[1]

The solution to this problem is to make sure flutter doctor is up to date. Even though it was when I first setup my project, I ran it on my Mac and to my surprise there were two commands I had to run related to Xcode which then automatically generated the podfile.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 matiboy212121