I use Android Studio as my IDE in coding Flutter. I was able to create 2 projects before this and it worked absolutely fine. I had to clone a repo from Github. The IDE said
It seems like this problem may have a lot of different symptoms, but for me to be able to run my flutter app in my android device, I had to set the android SDK in the Project Structure modal.
You can open the Project Structure modal by right clicking on the project root folder (in the file tree) > Module Settings > Project and set the Project SDK:
Mine is like this:
If somehow the Project tab is disabled or in a weird state, I recommend you to close android studio, delete the project .iml file and the .idea folder, reopen the project in AS (open existing project) and set the android SDK in the project structure like I've described above. At least this is what I did and it fixed for me, so I hope this answer help someone.