如何用VScode修复Flutter IOS运行问题



我在flutter应用程序中使用云firestore,我想在IOS上运行该应用程序。当我在iOS设备上运行我的应用程序时,它会给我错误:

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

这是我的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

当我添加pod时,我也会进行flutter清洁和pod安装以及flutter运行后。我面临这个问题

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 

完美
确保包裹是最新的

只需更改cloud_firestore的版本:在pubspec.yaml中,类似

cloud_firestore: ^2.2.2

然后运行:

flutter clean
flutter run 

最新更新