Module ‘cloud_firestore’ not found on xcode while using flutter. 


Solution:

Encountering frustrating errors while working with Flutter, especially when integrating Firebase Firestore, is not uncommon. Recently, I faced one such error while running my Flutter app on my Mac's Xcode. It was quite frustrating, but I believe sharing my experience might help others facing similar issues.

The error occurred during the process of setting up Firebase Firestore in my Flutter app and trying to run it on Xcode. Despite following the documentation and guides, I encountered unexpected errors, which led to frustration and wasted time.

However, I found that simplifying the problem and breaking it down into smaller steps helped me identify the root cause of the issue. By carefully reviewing my setup, dependencies, and configurations, I was able to resolve the error and successfully run my Flutter app with Firebase Firestore integration on Xcode.

Here are two solutions to resolve frustrating errors encountered while working with Flutter and Firebase Firestore on Xcode:


Solution 1:

  1. rm -rf ~/Library/Caches/CocoaPods
  2. rm -rf Pods   
  3. rm -rf ~/Library/Developer/Xcode/DerivedData/*
  4. pod deintegrate
  5. pod setup  
  6. pod install 

This solution works and solve the error 100%. If its not worked for you try Solution 2.

Solution 2:

1. Backup your ios folder to ensure you have a copy of it.

2. Backup your ios/runner/info.plist file.

3. Delete the entire ios folder from your Flutter project.

4. Recreate the ios folder by running `flutter create .` in the terminal from the root directory of your Flutter project.

5. Replace the ios/runner/info.plist file with your backup.

6. Run `flutter run` to rebuild and run the Flutter app.

if this solution is not working and you still got error try Solution 3.

Solution 3:

  1. pod cache clean --all
  2. pod deintegrate
  3. sudo gem install cocoapods-deintegrate cocoapods-clean
  4. sudo arch -x86_64 gem install ffi
  5. arch -x86_64 pod repo update
  6. arch -x86_64 pod install

Following these steps should help resolve the frustrating errors you encountered and allow you to continue working on your Flutter app with Firebase Firestore integration on Xcode. Feel free to give a 👏 if these solutions were helpful!