我是新的扑动,所以我正在firebase认证工作,并创建了一个扑动firebase项目,但当我运行flutter packages get
时,我得到了包错误。
我的输出看起来像这样
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
Try the new cross-platform PowerShell https://aka.ms/pscore6
PS E:new projfirebase authfirebase_auth_demo_flutter-master> flutter packages upgrade
Resolving dependencies...
Because every version of flutter_driver from sdk depends on test_api 0.3.0 and mockito >=4.1.2 <=5.0.0-nullsafety.7 depends on test_api ^0.2.19-nullsafety, flutter_driver from sdk is incompatible with mockito >=4.1.2 <=5.0.0-nullsafety.7.
So, because firebase_auth_demo_flutter depends on both flutter_driver any from sdk and mockito ^4.1.2, version solving failed.
pub finished with exit code 1
PS E:new projfirebase authfirebase_auth_demo_flutter-master>
在我的项目我的pubspec。Yaml文件如下所示
version: 0.2.0
environment:
sdk: ">=2.11.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
apple_sign_in: ^0.1.0
cupertino_icons: ^1.0.0
firebase_auth: ^0.18.4+1
firebase_core: ^0.5.3
firebase_dynamic_links: ^0.6.3
flutter_login_facebook: ^0.4.0+1
flutter_secure_storage: ^3.3.5
google_sign_in: ^4.5.6
package_info: ^0.4.3+2
provider: ^4.3.2+3
random_string: ^2.1.0
rxdart: ^0.25.0
dev_dependencies:
flutter_driver:
sdk: flutter
flutter_test:
sdk: flutter
mockito: ^4.1.2
test: any
# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec
# The following section is specific to Flutter.
错误信息以"Because every version…"其实很清楚。
您需要增加您使用的mockito的版本。你需要使用一个依赖于test_api 0.3.0的mock版本,就像你正在使用的Flutter SDK一样。
当两个包A和B依赖于一个包C时,需要有一个A和B都可以使用的C版本。