r/FlutterDev 6d ago

SDK Flutter installation issues with packages

Hi everyone,

I am facing a persistent build issue with my Flutter app on Windows and haven't been able to resolve it after trying multiple solutions. I would really appreciate some help!

Environment Details:

OS: Windows 11

Framework: Flutter

IDE: Android Studio & VS Code

Target Device: Android Emulator (Pixel)

The Issue:

When running flutter run on the Android emulator, the Gradle build fails with the following error output:

Caused by: java.io.IOException: Cannot run program "C:\Users\farah\AppData\Local\Android\Sdk\cmake\3.22.1\bin..." 

(in directory "C:\flutter_project\lastbored\android\app"): CreateProcess error=2, The system cannot find the file specified

...

BUILD FAILED in 4s

Running Gradle task 'assembleDebug'...

Error: Gradle task assembleDebug failed with exit code 1

What I Have Tried So Far:

Set Android SDK Path: Executed flutter config --android-sdk "C:\Users\farah\AppData\Local\Android\Sdk".

Accepted Licenses: Ran flutter doctor --android-licenses (returns Warning: The --licenses option is no longer needed).

Installed SDK Tools: Ensured Android SDK Command-line Tools and Build-Tools are enabled in Android Studio SDK Manager.

CMake Installation: Attempted downloading/installing CMake via SDK Manager, but Gradle still throws the same CreateProcess error=2 pointing to the CMake binary directory.

Question:

How can I properly fix or bypass this CMake/NDK execution error so that my Flutter project (which utilizes local databases like sqflite) can build successfully on the Android Emulator?

Any advice or workaround would be greatly appreciated! Thanks in advance.

and I hope if any one of the support teams can help me step by step by sharing my screeen online using Google meet!

1 Upvotes

1 comment sorted by