【发布时间】:2019-05-05 04:45:33
【问题描述】:
我正在尝试在我的依赖项中添加 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)
我已经试过了:
- 包获取
- 包升级
- 颤振升级
- 扑干净
- 在 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
Path_provider 文档:https://pub.dartlang.org/packages/path_provider
【问题讨论】:
-
你是否对你的flutter下载进行了本地修改或直接从git中检查出来?
-
如果你去 File->Settings->Languages&Frameworks->Flutter 它应该显示 SDK 和 Flutter SDK 路径。看起来不错吗?它显示的是什么版本?它是否也在版本中提到了 Dart(也许将其添加到问题中)?
-
我已经尝试下载 path_provider 包并用实际的包替换它,但它没有工作,所以我把它放回旧的(原始的)。是的,它显示了颤振路径:C:\src\flutter,版本:颤振 0.0.0-未知 • 通道未知 • 未知来源框架 • 修订版 c27c4a265e(7 天前) • 2018-11-26 17:07:24 -0500 引擎 • 修订版 eebc6a5895 工具 • Dart 2.1.0(内部版本 2.1.0-dev.9.4 f9ebf21297)
标签: android-studio dart flutter