gpt4 book ai didi

flutter - 克隆使用旧 sdk 和包的项目后如何解决所有 sdk 和依赖项问题?

转载 作者:行者123 更新时间:2023-12-03 21:11:13 27 4
gpt4 key购买 nike

我已经克隆了由谷歌开发人员在 YouTube 上的 flutter 无聊节目系列中开发的hackernews 项目。
在运行 flutter run 时,我收到这些错误。


The current Dart SDK version is 2.9.2.

Because no versions of test match >1.13.0 <1.14.0 and test >=1.16.0-nullsafety requires SDK version >=2.10.0-0 <2.10.0, test >1.13.0 <1.14.0-∞ or >=1.16.0-nullsafety is forbidden.
(1) So, because test >=1.3.0 <1.12.0 depends on boolean_selector ^1.0.0 and test >=1.12.0 <1.13.0 depends on test_api 0.2.14, test >=1.3.0 <1.13.0-∞ or >1.13.0 <1.14.0-∞ or >=1.16.0-nullsafety requires boolean_selector ^1.0.0 or test_api 0.2.14.

Because test >=1.14.5 <1.15.0 depends on test_api 0.2.16 and test >=1.13.0 <1.14.5 depends on test_api 0.2.15, test >=1.13.0 <1.15.0 requires test_api 0.2.15 or 0.2.16.
And because test >=1.15.0 <1.15.1 depends on test_core 0.3.8, test >=1.13.0 <1.15.1 requires test_api 0.2.15 or 0.2.16 or test_core 0.3.8.
And because test >=1.15.1 <1.15.2 depends on test_core 0.3.9 and test >=1.15.2 <1.15.3 depends on test_core 0.3.10, test >=1.13.0 <1.15.3 requires test_core 0.3.8 or 0.3.9 or 0.3.10 or test_api 0.2.15 or 0.2.16.
And because test >=1.3.0 <1.13.0-∞ or >1.13.0 <1.14.0-∞ or >=1.16.0-nullsafety requires boolean_selector ^1.0.0 or test_api 0.2.14 (1), test >=1.3.0 <1.15.3-∞ or >=1.16.0-nullsafety requires boolean_selector ^1.0.0 or test_api 0.2.14 or 0.2.15 or 0.2.16 or test_core 0.3.8 or 0.3.9 or 0.3.10.
And because every version of flutter_test from sdk depends on both boolean_selector 2.0.0 and test_api 0.2.17, if flutter_test any from sdk and test >=1.3.0 <1.15.3-∞ or >=1.16.0-nullsafety then test_core 0.3.8 or 0.3.9 or 0.3.10.
(2) So, because test >=1.15.3 <1.16.0-nullsafety depends on test_core 0.3.11 which depends on analyzer ^0.39.5, if flutter_test any from sdk and test >=1.3.0 then analyzer ^0.39.5.

Because no versions of built_value_generator match >6.5.0 <6.6.0 and built_value_generator >=6.6.0 <6.8.0 depends on analyzer >=0.34.0 <0.37.0, built_value_generator >6.5.0 <6.8.0 requires analyzer >=0.34.0 <0.37.0.
And because built_value_generator >=6.8.0 <7.0.4 depends on analyzer >=0.34.0 <0.39.0 and built_value_generator 6.5.0 depends on analyzer >=0.33.3 <0.37.0, built_value_generator >=6.5.0 <7.0.4 requires analyzer >=0.33.3 <0.39.0.
And because if flutter_test any from sdk and test >=1.3.0 then analyzer ^0.39.5 (2), one of flutter_test any from sdk or test >=1.3.0 or built_value_generator >=6.5.0 <7.0.4 must be false.
And because hn_app depends on built_value_generator ^6.5.0, flutter_test from sdk is incompatible with test >=1.3.0.
So, because hn_app depends on both test ^1.6.1 and flutter_test any from sdk, version solving failed.
Running "flutter pub get" in hn_app...
pub get failed (1; So, because hn_app depends on both test ^1.6.1 and
flutter_test any from sdk, version solving failed.)

最佳答案

从 pubspec.yaml 中的依赖项中删除所有版本号,并让 Flutter 确定版本
例子:
替换这个

test: ^1.15.0
test_core: 0.3.8
有了这个
test: 
test_core:

关于flutter - 克隆使用旧 sdk 和包的项目后如何解决所有 sdk 和依赖项问题?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63771432/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com