How can i fix Flutter IOS run problem with VScode?

Viewed 145

I'm using cloud firestore in my flutter application and I want to run app on IOS. When i run my app on iOS device its give me that error:

/ios/Runner/generatedPluginRegistrant.m:10:9: fatal error: module 'cloud_firestore' not found
    @import cloud_firestore;
     ~~~~~~~^~~~~~~~~~~~~~~
    1 error generated.
    note: Using new build system
    note: Building targets in parallel
    note: Planning build
    note: Analyzing workspace
    note: Constructing build description
    note: Build preparation complete
Could not build the application for the simulator.
Error launching application on iPhone 12 Pro.

this is my podfile:

# Uncomment the next line to define a global platform for your project
platform :ios, '10.0'

target 'Runner' do
  # Comment the next line if you don't want to use dynamic frameworks
  use_frameworks!

  # Pods for Runner

pod 'Firebase/Auth'
pod 'FirebaseFirestore', :git => 'https://github.com/invertase/firestore-ios-sdk-frameworks.git', :tag => '8.0.0'


end

and when i add pods i also do flutter clean and pod install and after flutter run. And i faced this problem

2 Answers

Just change version of cloud_firestore: in pubspec.yaml like below

cloud_firestore: ^2.2.2

Then run:

flutter clean
flutter run 
1-flutter clean
2-rm -rf Pods
3-rm Podfile.lock
4-sudo gem install cocoapods-deintegrate cocoapods-clean
5-Pod clean
6-pod init
7-flutter pub get
8-flutter run 

Perfect
make sure the package is up to date

Related