Flutter commands stuck waiting for startup lock

Viewed 1791

I'm using macOS Catalina v10.15.5, and just installed flutter using git. But whenever I execute flutter commands (flutter doctor, flutter precache), I'm stuck at Waiting for another flutter command to release the startup lock...

Has been leaving it for >30min, still stuck at the error page.

List of solutions I've tried:

  • killall -9 dart -> gets "No matching processes belonging to you were found FAIL: 1"
  • Removing <YOUR FLUTTER FOLDER>/bin/cache/lockfile -> there is no lockfile
  • delete the directory & restart PC & download again -> still the same error message
2 Answers

Try remove flock check in _lock function in bin/internal/shared.sh like this

function _lock () {
  if hash shlock 2>/dev/null; then
    shlock -f "$1" -p $$
  else
    mkdir "$1" 2>/dev/null
  fi
}

For my case, my mac system had a flock enabled, but it was failing to acquire the lock.

Try creating a new flutter project via File > Create new flutter project. This will remove the lock.

Related