简体   繁体   English

Flutter:firebase_auth 取决于 firebase_auth_platform_interface 错误

[英]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:这里的问题是:

  • flutter_test depends on collection 1.15.0 flutter_test 依赖于集合1.15.0
  • firebase_auth depends on collection ^1.16.0 firebase_auth 取决于集合^1.16.0

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.

相关问题 Flutter 断言错误:flutter:'package:firebase_auth_platform_interface/src/method_channel/method_channel_user_credential.dart':断言失败 - Flutter Assertion Error: flutter: 'package:firebase_auth_platform_interface/src/method_channel/method_channel_user_credential.dart': Failed assertion Firebase_auth 取决于 firebase_core 错误 - Firebase_auth depends on firebase_core error Flutter 依赖中的版本错误,包含 dialogflow、firebase_auth 和 http - Error with version in Flutter depencies with dialogflow, firebase_auth and http 如何解决flutter中的内部错误以使用firebase_auth - How to solve Internal error in flutter to use firebase_auth Flutter firebase_auth signInWithCredential 不适用于 android - Flutter firebase_auth signInWithCredential is not working on android Flutter - firebase_auth updateProfile 方法不起作用 - Flutter - firebase_auth updateProfile method is not working Flutter firebase_auth package URI 未找到 - Flutter firebase_auth package URI not found Dart Flutter 顺序 firebase_auth 错误 - Dart Flutter sequential firebase_auth errors Flutter&Firebase-与firebase_auth一起使用firebase_storage - Flutter & Firebase - using firebase_storage along with firebase_auth Firebase_auth 无法在 flutter [firebase_auth: ^0.16.1] 上构建发布 apk - Firebase_auth cannot build release apk on flutter [firebase_auth: ^0.16.1]
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM