Flutter应用程序给出了错误“ app_name”,取决于fld中不存在的sdk中的任何内容(未知sdk“ flutter””),版本解析失败

时间:2018-12-08 05:42:52

标签: dart flutter

在运行 flutter软件包获取命令时,出现以下错误。

我添加以下插件时开始出现错误。

flutter_native_image:
  git: https://github.com/btastic/flutter_native_image.git

即使删除了插件,我仍然遇到相同的错误!

enter image description here

我正在尝试添加flutter_native_image插件

pubspec.yaml

    name: login_authentication
    description: A new Flutter project.

    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

      firebase_auth:

      firebase_storage:

      google_sign_in:

      image_picker:

    dev_dependencies:
      flutter_test:
        sdk: flutter

    # The following section is specific to Flutter.
    flutter:
      uses-material-design: true

2 个答案:

答案 0 :(得分:0)

以下步骤解决了我的问题

  1. 转到文件菜单,然后单击设置
  2. 打开语言和框架 => Flutter
  3. 您将看到Flutter SDK路径为空。提供从网上下载Flutter的flutter SDK的位置。

答案 1 :(得分:0)

什么都行不通,直到我完全重新安装Flutter为止,一切都正常。