[英]Flutter : firebase_auth depends on firebase_auth_platform_interface Error
I am trying to use firebase for my project.我正在尝试将 firebase 用于我的项目。 When I click on PUB GET, I get this error
当我单击 PUB GET 时,我收到此错误
"Because firebase_auth >=3.5.0 depends on firebase_auth_platform_interface ^6.4.0 which depends on collection ^1.16.0, firebase_auth >=3.5.0 requires collection ^1.16.0. And because every version of flutter_test from sdk depends on collection 1.15.0, firebase_auth >=3.5.0 is incompatible with flutter_test from sdk. So, because quick_chat depends on both flutter_test from sdk and firebase_auth ^3.5.1, version solving failed. pub get failed (1; So, because quick_chat depends on both flutter_test from sdk and firebase_auth ^3.5.1, version solving failed.)" “因为 firebase_auth >=3.5.0 依赖于 firebase_auth_platform_interface ^6.4.0,它依赖于集合 ^1.16.0,所以 firebase_auth >=3.5.0 需要集合 ^1.16.0。因为来自 sdk 的每个版本的 flutter_test 都依赖于集合 1.15。 0, firebase_auth >=3.5.0 is not compatible with flutter_test from sdk. 所以,因为 quick_chat 依赖于来自 sdk 的 flutter_test 和 firebase_auth ^3.5.1,版本解析失败。pub get failed (1_所以,因为 quick_chat 都依赖于 quick_chat来自 sdk 和 firebase_auth ^3.5.1,版本解析失败。)”
Pubspec.yml file: Pubspec.yml 文件:
dependencies:
flutter:
sdk: flutter
firebase_auth: ^3.5.1
firebase_core: ^1.20.0
cloud_firestore: ^3.4.1
How do I solve this?我该如何解决这个问题?
The problem here is:这里的问题是:
And package manager cannot decide which version to use.并且 package 管理器无法决定使用哪个版本。
What you can do here:你可以在这里做什么:
Option 1: Upgrade flutter_test (I believe it comes with SDK, so you need to upgrade Flutter SDK)方案一:升级flutter_test(相信是SDK自带的,所以需要升级Flutter SDK)
Option 2: Downgrade firebase_auth to the version that depends on collection 1.15.0选项 2:将 firebase_auth 降级到依赖集合1.15.0的版本
Option 3: Specify dependency_overrides (this will force chose the version of the library, use as last resort):选项3:指定dependency_overrides(这将强制选择库的版本,作为最后的手段):
dependency_overrides:
collection ^1.16.0
https://dart.dev/tools/pub/dependencies#dependency-overrideshttps://dart.dev/tools/pub/dependencies#dependency-overrides
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.