Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flutter build error with cmake missing #7445

Open
akshaybabloo opened this issue May 22, 2024 · 0 comments
Open

Flutter build error with cmake missing #7445

akshaybabloo opened this issue May 22, 2024 · 0 comments

Comments

@akshaybabloo
Copy link

The application errors out with:

Error: CMake is required for Linux development.
It is likely available from your distribution (e.g.: apt install cmake), or can be downloaded from https://cmake.org/download/

Even though I have cmake installed. Here is the output for cmake:

$ cmake --version
cmake version 3.29.3

CMake suite maintained and supported by Kitware (kitware.com/cmake).

$ which cmake
/home/akshay/cmake/bin/cmake

Is there a way I can tell the flutter plugin where to look for the cmake binary. It's working fine when I do flutter run from the terminal.

The IDE is not able to locate cmake, see flutter doctor -v below from IDE vs Terminal

Steps to Reproduce

  1. Install cmake from https://cmake.org/download/ and not using apt
  2. Create a new Linux Flutter application
  3. Run the app via IDE

Version info

Flutter doctor from IDE

/home/akshay/flutter/bin/flutter doctor --verbose
[!] Flutter (Channel stable, 3.22.0, on Ubuntu 22.04.4 LTS 6.5.0-35-generic, locale en_NZ.UTF-8)
    • Flutter version 3.22.0 on channel stable at /home/akshay/flutter
    ! The flutter binary is not on your path. Consider adding /home/akshay/flutter/bin to your path.
    ! The dart binary is not on your path. Consider adding /home/akshay/flutter/bin to your path.
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 5dcb86f68f (13 days ago), 2024-05-09 07:39:20 -0500
    • Engine revision f6344b75dc
    • Dart version 3.4.0
    • DevTools version 2.34.3
    • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /home/akshay/Android/Sdk
    • Platform android-34, build-tools 34.0.0
    • Java binary at: /home/akshay/.local/share/JetBrains/Toolbox/apps/android-studio/jbr/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.10+0-17.0.10b1087.21-11572160)
    • All Android licenses accepted.

[✗] 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
    • Ubuntu clang version 14.0.0-1ubuntu1.1
    ✗ CMake is required for Linux development.
      It is likely available from your distribution (e.g.: apt install cmake), or can be downloaded from https://cmake.org/download/
    • ninja version 1.12.0
    • pkg-config version 0.29.2

[✓] Android Studio (version 2023.3)
    • Android Studio at /home/akshay/.local/share/JetBrains/Toolbox/apps/android-studio
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.10+0-17.0.10b1087.21-11572160)

[✓] IntelliJ IDEA Ultimate Edition (version 2024.1)
    • IntelliJ at /home/akshay/.local/share/JetBrains/Toolbox/apps/intellij-idea-ultimate
    • Flutter plugin version 79.1.3
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart

[✓] VS Code (version 1.89.1)
    • VS Code at /snap/code/current/usr/share/code
    • Flutter extension version 3.88.0

[✓] Connected device (2 available)
    • i350 fisher paykel (mobile) • i350fisher_paykel • android-arm64 • Android 11 (API 30)
    • Linux (desktop)             • linux             • linux-x64     • Ubuntu 22.04.4 LTS 6.5.0-35-generic

[✓] Network resources
    • All expected network resources are available.

! Doctor found issues in 3 categories.
Process finished with exit code 0

Flutter Doctor from Terminal

[✓] Flutter (Channel stable, 3.22.0, on Ubuntu 22.04.4 LTS 6.5.0-35-generic, locale en_NZ.UTF-8)
    • Flutter version 3.22.0 on channel stable at /home/akshay/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 5dcb86f68f (13 days ago), 2024-05-09 07:39:20 -0500
    • Engine revision f6344b75dc
    • Dart version 3.4.0
    • DevTools version 2.34.3

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /home/akshay/Android/Sdk
    • Platform android-34, build-tools 34.0.0
    • Java binary at: /home/akshay/.local/share/JetBrains/Toolbox/apps/android-studio/jbr/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.10+0-17.0.10b1087.21-11572160)
    • All Android licenses accepted.

[✗] 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
    • Ubuntu clang version 14.0.0-1ubuntu1.1
    • cmake version 3.29.3
    • ninja version 1.12.0
    • pkg-config version 0.29.2

[✓] Android Studio (version 2023.3)
    • Android Studio at /home/akshay/.local/share/JetBrains/Toolbox/apps/android-studio
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.10+0-17.0.10b1087.21-11572160)

[✓] IntelliJ IDEA Ultimate Edition (version 2024.1)
    • IntelliJ at /home/akshay/.local/share/JetBrains/Toolbox/apps/intellij-idea-ultimate
    • Flutter plugin version 79.1.3
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart

[✓] VS Code (version 1.89.1)
    • VS Code at /snap/code/current/usr/share/code
    • Flutter extension version 3.88.0

[✓] Connected device (2 available)
    • i350 fisher paykel (mobile) • i350fisher_paykel • android-arm64 • Android 11 (API 30)
    • Linux (desktop)             • linux             • linux-x64     • Ubuntu 22.04.4 LTS 6.5.0-35-generic

[✓] Network resources
    • All expected network resources are available.

! Doctor found issues in 1 category.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant