包需要 Flutter SDK 版本 >=0.1.4 <2.0.0

Lív*_*ago 5 dart android-studio flutter

我正在尝试在我的依赖项中添加 path_provider 包,但我总是收到此错误:

The current Flutter SDK version is 0.0.0-unknown.


Because lista_tarefas depends on path_provider >=0.4.0 which requires Flutter SDK version >=0.1.4 <2.0.0, version solving failed.

pub upgrade failed (1)
Run Code Online (Sandbox Code Playgroud)

我已经试过了:

  • 包得到
  • 包升级
  • 颤振升级
  • 扑干净
  • 在 pugspec.yaml 的环境变量中写入其他版本
  • 删除 pugspec.yaml 中的环境变量
  • 使用旧版本的 path_provider
  • 使 Android Studio 中的缓存失效

我当前的 pubspec.yaml 文件:

...

version: 1.0.0+1

environment:
  sdk: ">=2.0.0-dev.68.0 <3.0.0"



dependencies:
  flutter:
    sdk: flutter

  # The following adds the Cupertino Icons font to your application.
  # Use with the CupertinoIcons class for iOS style icons.
  cupertino_icons: ^0.1.2
  path_provider: "^0.4.1"

dev_dependencies:
  flutter_test:
    sdk: flutter


# For information on the generic Dart part of this file, see the
# following page: https://www.dartlang.org/tools/pub/pubspec

# The following section is specific to Flutter.
flutter:

  # The following line ensures that the Material Icons font is
  # included with your application, so that you can use the icons in
  # the material Icons class.
  uses-material-design: true
Run Code Online (Sandbox Code Playgroud)

Path_provider 文档:https ://pub.dartlang.org/packages/path_provider

Rav*_*lal 0

您使用的path_provider包需要低于2.0.0的flutter sdk版本,并且您使用的sdk是2.0.0-dev.68.0或更高版本。您需要降级您的 sdk 或将 path_provider 包升级到兼容的包。

\n\n

使用以下命令降级flutter sdk

\n\n

flutter version <version>

\n\n

使用以下命令检查所有可用版本:

\n\n
flutter version\n
Run Code Online (Sandbox Code Playgroud)\n\n

以下命令告诉您当前的 sdk 版本

\n\n
flutter --version \n\nFlutter 1.1.8 \xe2\x80\xa2 channel unknown \xe2\x80\xa2 unknown source\nFramework \xe2\x80\xa2 revision 985ccb6d14 (12 months ago) \xe2\x80\xa2 2019-01-08 13:45:55 -0800\nEngine \xe2\x80\xa2 revision 7112b72cc2\nTools \xe2\x80\xa2 Dart 2.1.1 (build 2.1.1-dev.0.1 ec86471ccc)\n
Run Code Online (Sandbox Code Playgroud)\n