Flutter - 找不到名为“-”的命令

奥马尔·阿贝德

有没有人遇到过这个问题?

或者有人有解决方案吗?

当我开始运行 Flutter 程序时,我遇到了这个问题。我删除了sdk并重新下载了它,但无济于事

Could not find a command named "-".
Usage: dart <command|dart-file> [arguments]

Global options:
-h, --help                 Print this usage information.
-v, --verbose              Show additional command output.
    --version              Print the Dart SDK version.
    --enable-analytics     Enable analytics.
    --disable-analytics    Disable analytics.

Available commands:
  analyze   Analyze Dart code in a directory.
  compile   Compile Dart to various formats.
  create    Create a new Dart project.
  fix       Apply automated fixes to Dart source code.
  format    Idiomatically format Dart source code.
  migrate   Perform null safety migration on a project.
  pub       Work with packages.
  run       Run a Dart program.
  test      Run tests for a project.
Run "dart help <command>" for more information about a command.
See https://dart.dev/tools/dart-tool for detailed documentation.
Exception: Gradle task assembleDebug failed with exit code 64
Exited (sigterm)
阿尔佩伦巴斯卡亚

当 flutter 和 dart sdk 位于 C:\ 目录并且您的项目位于不同的目录(如 D:\ )时,就会发生这种情况。在 sdks 所在的同一目录中创建项目。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章