flutter-intellij icon indicating copy to clipboard operation
flutter-intellij copied to clipboard

Flutter build error with cmake missing

Open akshaybabloo opened this issue 9 months ago • 0 comments

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.

akshaybabloo avatar May 22 '24 03:05 akshaybabloo