"flutter run" works in OS terminal but not in Visual Studio Code

It’s fixed!!

But I don’t know exactly what fixed it. I upgraded my channel from the stable 23.11 to unstable and all of a sudden, the shell inside and outside of VS Code started outputting the same thing. Though, after updating, I started getting the following error even in the normal shell outside of VS Code whereas previously the flutter application was running from there:

This is despite flutter doctor -v telling me that ninja is installed. As per user K900’s suggestion in Matrix chat, I ran flutter clean in the affected flutter application folder and that fixed this error!! Hope this helps anyone facing a similar problem in the future.

P.S: I didn’t have cmake, clang, ninja, nor pkg-config listed as packages in my configuration file, just flutter.