gpt4 book ai didi

android - 异常 : Unable to generate build files in flutter

转载 作者:行者123 更新时间:2023-12-04 23:46:43 24 4
gpt4 key购买 nike

我正在尝试在 kali linux 机器上安装 flutter 。我从官方网站安装了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)
谁能帮我解决这个问题。

最佳答案

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

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

flutter config --enable-linux-desktop

关于android - 异常 : Unable to generate build files in flutter,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67169985/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com