堆栈溢出提到我之前发布了低质量的问题,所以这是我尝试提出高质量的问题......
跑步时我得到一个
flutter run
。这看起来很奇怪,因为它只有在将 cloud_firestore: ^4.17.3
添加到依赖项后才会发生。这是错误:
Error: CocoaPods's specs repository is too out-of-date to satisfy dependencies.
To update the CocoaPods specs, run:
pod repo update
Error running pod install
Error launching application on iPhone 14.
作为参考,这是我的依赖项:
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^1.0.6
flutter_osm_plugin: ^1.0.3
intro_slider: ^4.2.1
salomon_bottom_bar: ^3.3.2
csv: ^5.0.0
ml_dataframe: ^1.6.0
latlong2: ^0.9.1
flutter_map: ^6.1.0
firebase_core: ^2.30.1
firebase_auth: ^4.19.4
cloud_firestore: ^4.17.3
到目前为止我尝试过什么?
pod repo update
cd ios
,然后是pod install
。这会返回以下错误(我也尝试过它的建议):[!] CocoaPods could not find compatible versions for pod "Firebase/CoreOnly":
In snapshot (Podfile.lock):
Firebase/CoreOnly (= 10.24.0)
In Podfile:
firebase_core (from `.symlinks/plugins/firebase_core/ios`) was resolved to 2.31.0, which depends on
Firebase/CoreOnly (= 10.25.0)
You have either:
* out-of-date source repos which you can update with `pod repo update` or with `pod install --repo-update`.
* changed the constraints of dependency `Firebase/CoreOnly` inside your development pod `firebase_core`.
You should run `pod update Firebase/CoreOnly` to apply changes you've made.
运行 Firebase/Core 仅返回:
Pod installation complete! There are 7 dependencies from the Podfile and 30 total pods installed.
[!] CocoaPods did not set the base configuration of your project because your project already has a custom config set. In order for CocoaPods integration to work at all, please either set the base configurations of the target `Runner` to `Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig` or include the `Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig` in your build configuration (`Flutter/Release.xcconfig`).
我按照这些说明进行操作 - 没有成功。然后我尝试启动一个新项目(因此它不应该有自定义构建配置),将 cloudfirestore 和 firebase_auth 添加到依赖项中,我遇到了同样的问题。
这些步骤对我有用:
flutter clean
Remove /ios/Pods
Remove /ios/Podfile.lock
flutter pub get
from inside ios folder: pod install
flutter run