gpt4 book ai didi

flutter - 无法运行 'flutter pub get' 因为我的 sdk 版本低于它应该是

转载 作者:行者123 更新时间:2023-12-05 08:04:52 25 4
gpt4 key购买 nike

我在项目中遇到问题。我想迁移到 flutter with null-safety。但是当我想运行“flutter pub get”时,我收到消息 -

The current Dart SDK version is 2.12.0-133.2.beta.

Because flutter_shareit requires SDK version >=2.12.0 <3.0.0, version solving failed.pub upgrade failed (1; Because flutter_shareit requires SDK version >=2.12.0 <3.0.0, version solving failed.)

我的 flutter 和 dart 版本是

Flutter 2.0.5 • channel stable • https://github.com/flutter/flutter.gitFramework • revision adc687823a (4 days ago) • 2021-04-16 09:40:20 -0700Engine • revision b09f014e96Tools • Dart 2.12.3

我尝试使用 flutter clean,但一切仍然保持不变

我的 pubspec.yaml

environment:
sdk: ">=2.12.0 <3.0.0"

dependencies:
flutter:
sdk: flutter

cupertino_icons: ^1.0.2
flutter_icons: ^1.1.0
dots_indicator: ^2.0.0
flutter_staggered_grid_view: ^0.4.0
flutter_point_tab_bar: ^0.2.0
splashscreen: ^1.3.5




dev_dependencies:
flutter_test:
sdk: flutter
flutter_launcher_icons: "^0.8.1"

flutter_icons:
image_path: "assets/icons/logoo.png"
android: true
ios: true

flutter:
uses-material-design: true

assets:
- assets/images/friends/
- assets/images/posts/
- assets/images/saved/
- assets/images/story/
- assets/images/splash/
# - images/a_dot_ham.jpeg

fonts:
- family: Ubuntu-Regular
fonts:
- asset: assets/fonts/Ubuntu-Regular.ttf
# - asset: fonts/Schyler-Italic.ttf
# style: italic
# - family: Trajan Pro
# fonts:
# - asset: fonts/TrajanPro.ttf
# - asset: fonts/TrajanPro_Bold.ttf
# weight: 700

最佳答案

将 sdk 设置为 ">=2.10.0 <3.0.0" .切换到稳定版,然后将 flutter 升级到 2.0。

之后,您应该检查所有包并首先将它们升级到空安全。

只需关注 migration guide了解更多详情

关于flutter - 无法运行 'flutter pub get' 因为我的 sdk 版本低于它应该是,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67186089/

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