当前位置:   article > 正文

Dart Flutter 报错:SDK constraint:environment: sdk: ‘^2.12.0‘_resolving dependencies... pubspec.yaml has no lowe

resolving dependencies... pubspec.yaml has no lower-bound sdk constraint. yo
  1. [Dart语法] dart pub get
  2. Resolving dependencies...
  3. pubspec.yaml has no lower-bound SDK constraint.
  4. You should edit pubspec.yaml to contain an SDK constraint:
  5. environment:
  6. sdk: '^2.12.0'

在 pubspec.yaml 文件中添加

  1. environment:
  2. sdk: '^2.12.0'

然后再重新:

dart pub get

如果接着出现下面报错:

Got TLS error trying to find package http at https://pub.dev.

那么修改镜像:

我这里使用的是腾讯镜像:

配置环境变量的方式(win10)

分别新建两个变量:

变量名:

PUB_HOSTED_URL

值:

https://mirrors.cloud.tencent.com/dart-pub

变量名:

FLUTTER_STORAGE_BASE_URL

值:

https://mirrors.cloud.tencent.com/flutter

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小蓝xlanll/article/detail/332489
推荐阅读
相关标签
  

闽ICP备14008679号