flutter 当我尝试将firebase包添加到pubsec.yaml文件时,收到nullsafety错误

olmpazwi  于 2023-03-09  发布在  Flutter
关注(0)|答案(1)|浏览(133)

我正在尝试将Firebase添加到名为biletsatisFlutter App中。
但是当我尝试pub get时,我得到了这个错误。

[biletsatis] flutter pub get
Running "flutter pub get" in biletsatis...
Resolving dependencies...
Because firebase_core >=0.7.0 <0.8.0-1.0.nullsafety.0 depends on firebase_core_platform_interface ^3.0.1 and cloud_firestore >=4.3.2 depends on firebase_core_platform_interface ^4.5.3, firebase_core >=0.7.0 <0.8.0-1.0.nullsafety.0 is incompatible with cloud_firestore >=4.3.2.
So, because biletsatis depends on both cloud_firestore ^4.4.3 and firebase_core ^0.7.0, version solving failed.
pub get failed
command: "C:\Users\USER\flutter\bin\cache\dart-sdk\bin\dart __deprecated_pub --directory . get --example"
pub env: {
  "FLUTTER_ROOT": "C:\Users\USER\flutter",
  "PUB_ENVIRONMENT": "vscode.dart-code:flutter_cli:get",
  "PUB_CACHE": "C:\Users\USER\AppData\Local\Pub\Cache",
}
exit code: 1

exit code 1

下面是pubsec.yaml文件中的dependencies部分

flutter:
    sdk: flutter
  
  flutter_form_bloc: ^0.30.1

  cupertino_icons: ^1.0.2
  
  cloud_firestore: ^4.4.3
  firebase_core: ^0.7.0
q8l4jmvw

q8l4jmvw1#

尝试使用

flutter pub upgrade --major-versions

使用此命令,Flutter项目中的所有依赖项都将更新为最新的主要版本。

相关问题