【问题标题】:Exception: Unable to generate build files in flutter异常:无法在颤振中生成构建文件
【发布时间】:2021-04-19 22:13:21
【问题描述】:

我正在尝试在 kali linux 机器上安装颤振。我从官方网站安装了flutter并进行了相应的操作。我不想使用 android studio,所以我使用的是 Visual Studio 代码。
当我在终端运行 Flutter doctor 时,我得到了

[✓] Flutter (Channel master, 2.2.0-11.0.pre.161, on Linux, locale en_IN)
[✗] Android toolchain - develop for Android devices
    ✗ Unable to locate Android SDK.
      Install Android Studio from: https://developer.android.com/studio/index.html
      On first launch it will assist you in installing the Android SDK components.
      (or visit https://flutter.dev/docs/get-started/install/linux#android-setup for detailed instructions).
      If the Android SDK has been installed to a custom location, please use
      `flutter config --android-sdk` to update to that location.

[✗] Chrome - develop for the web (Cannot find Chrome executable at google-chrome)
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[☠] Linux toolchain - develop for Linux desktop (the doctor check crashed)
    ✗ Due to an error, the doctor check did not complete. If the error message below is not helpful, please let us know about this issue at
      https://github.com/flutter/flutter/issues.
    ✗ ProcessException: Failed to find "ninja" in the search path.
        Command: ninja 
[!] Android Studio (not installed)
[✓] VS Code (version 1.55.2)
[✓] Connected device (1 available)

! Doctor found issues in 4 categories.

当我在 Visual Studio 中运行时,我得到了这个

Launching lib/main.dart on Linux in debug mode...
lib/main.dart:1
CMake Error: CMake was unable to find a build program corresponding to "Ninja".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
Exception: Unable to generate build files
Exited (sigterm)

谁能帮我解决这个问题。

【问题讨论】:

    标签: android visual-studio flutter kali-linux


    【解决方案1】:

    你必须安装忍者。

    sudo pacman -S ninjasudo apt-get install ninja

    【讨论】:

      【解决方案2】:

      我使用以下命令找到了解决方案:

      sudo apt-get install clang cmake ninja-build pkg-config libgtk-3-dev

      flutter 配置 --enable-linux-desktop

      【讨论】:

      • 添加这个命令 sudo apt install liblzma-dev 加上你的为我工作
      • 这对我有用,谢谢。
      猜你喜欢
      • 1970-01-01
      • 2020-11-09
      • 2020-12-05
      • 2020-08-27
      • 2021-06-18
      • 1970-01-01
      • 2021-10-15
      • 1970-01-01
      相关资源
      最近更新 更多