I am using Windows 10 with VS Code, although I also tested it on PowerShell, and both produced the same result:
After creating a new flutter program, before editing anyt
This error gets thrown when you try to run flutter build apk
command (at least, it was in my case) while not being in the project
directory. Usually, a flutter app's project directory path (let's say it is in F drive, and inside a folder named apps
, is as:
F:\Apps\app_name
I had the same issue, and the culprit in my case was this path: F:\Apps\app_name\android
which is without a doubt, NOT a project directory. So, all I had to do was type this command in terminal: cd ..
which takes to the parent directory.
So, before running the command, make sure to check out the directory being shown in terminal.