flutterwindowsdartcmaketext-to-speech

flutter_tts build error: NUGET.EXE not found. CMake Error


I ran into an issue after I did flutter pub add flutter_tts. when building, it immediately started giving a weird CMake build error (which I don't understand), making the build fail. It looks similar to https://github.com/flutter/flutter/issues/95898, but that's in a different package. I'm hoping that someone can provide some clues as to what is going on here and how I might be able to fix it. (so I can continue to work on my app). here's the error that I'm encountering:

Launching lib\main.dart on Windows in debug mode...
NUGET.EXE not found.
CMake Error at flutter/ephemeral/.plugin_symlinks/flutter_tts/windows/CMakeLists.txt:9 (message):
Please install this executable, and run CMake again.
Please install this executable, and run CMake again.
Error: Unable to generate build files
Exited (1).

I tried to install nuget.exe and add the folder of the location of nuget.exe to PATH, but that didn't fix the issue.


Solution

  • What worked for me:

    1. download nuget.exe from https://www.nuget.org/downloads
    2. put nuget.exe in C:/Windows/System32
    3. restart VSCode
    4. run flutter clean
    5. run flutter pub get
    6. try to start a new debug session. it should work now.