In my case, I got the error because I updated the version of a particular library. Use Ctrl + C or Cmd + C and rerun the project.
Ctrl + C
Cmd + C