我正在尝试为我的flutter应用运行一些基本的单元测试,但是当我运行pub get时,我在包含test之后得到了以下错误:1.20.0在我的发布规范中:
dev_dependencies:
dependency_validator: ^3.1.0 # run flutter pub run dependency_validator
#integration_test:
# sdk: flutter
flutter_test:
sdk: flutter
test: ^1.20.0
所以当我运行f pub get
时,我看到:
Because test >=1.20.0 depends on test_api 0.4.9 and every version of flutter_test from sdk depends on test_api 0.4.3, test >=1.20.0 is incompatible with flutter_test from sdk.
So, because myapp depends on both flutter_test from sdk and test ^1.20.0, version solving failed.
pub get failed (1; So, because myapp depends on both flutter_test from sdk and test ^1.20.0, version solving failed.)```
What version of test uses test_api 0.4.3?
3条答案
按热度按时间ukdjmx9f1#
我可以只使用导入'package:flutter_test/flutter_test. dart';而不是直接从测试包导入到我的测试文件中。所以我不需要包含test:在我的出版规范里是1.20.0。
1tuwyuhd2#
尝试在pubspec.yaml文件中将test_API重写为0.4.9:
或
你可以在下次flutter更新的时候删除这个。
14ifxucb3#
在相关性覆盖中添加测试API
示例: