When I run my flutter application it show
Waiting for another flutter command to release the startup lock
this messages and not
You can try to all flutter
processes.
TL;DR - go to point 4)
ps aux
flutter
:ps aux | grep flutter
where output can be like there:
stackoverflow 16697 1.5 0.0 4288316 704 ?? S 10:02PM 0:15.80 bash /flutter_path/flutter/bin/flutter --no-color build apk
stackoverflow 2800 1.5 0.0 4288316 704 ?? S 9:59PM 0:18.49 bash /flutter_path/flutter/bin/flutter --no-color pub get
stackoverflow 1215 1.5 0.0 4280124 700 ?? S 9:58PM 0:18.89 bash /flutter_path/flutter/bin/flutter --no-color config --machine
stackoverflow 8449 1.5 0.0 4296508 716 ?? S 10:00PM 0:17.20 bash /flutter_path/flutter/bin/flutter --no-color pub get
stackoverflow 1326 1.4 0.0 4288316 708 ?? S 9:58PM 0:18.97 bash /flutter_path/flutter/bin/flutter daemon
stackoverflow 16687 0.0 0.0 4279100 820 ?? S 10:02PM 0:00.01 bash /flutter_path/flutter/bin/flutter --no-color build apk
stackoverflow 8431 0.0 0.0 4288316 804 ?? S 10:00PM 0:00.02 bash /flutter_path/flutter/bin/flutter --no-color pub get
stackoverflow 2784 0.0 0.0 4288316 704 ?? S 9:59PM 0:00.01 bash /flutter_path/flutter/bin/flutter --no-color pub get
stackoverflow 1305 0.0 0.0 4280124 712 ?? S 9:58PM 0:00.01 bash /flutter_path/flutter/bin/flutter daemon
stackoverflow 1205 0.0 0.0 4279100 788 ?? S 9:58PM 0:00.01 bash /flutter_path/flutter/bin/flutter --no-color config --machine
stackoverflow 11416 0.0 0.0 4268176 536 s000 R+ 10:18PM 0:00.00 grep --color flutter
We need content from second column (from above output):
ps aux | grep flutter | awk '{print $2}'
To list, search and kill all of them you can use
kill $(ps aux | grep flutter | grep -v grep | awk '{print $2}')
(you can run it also with sudo
)
or
ps aux | grep flutter | grep -v grep | awk '{print $2}' | xargs kill -15
You can kill processes one-by-one using:
sudo kill -15 <process_ID>
e.g. to kill process with id 12345
use:
sudo kill -15 13245
If -15
will not work, you can try -2
or -1
.
Final option it is -9
which should not be used because it prevents the process from doing any cleanup work.
I have the same issue, I tried all the above solutions, but none of them worked for me. Then I searched the keywords in flutter directory, and found the following code. So I tried to delete bin/cache/.upgrade_lock
, and it worked finally.
I also faced same issue i followed the best and the easiest way
Environment : Windows
IDE : Android Studio
Tools>flutter(last option)> select flutter clean
after flutter clean finished you all set and good to go.
If you're using Android Studio save your work and close it. And open your terminal to kill running dart instances.
Linux:
killall -9 dart
Windows:
taskkill /F /IM dart.exe
lockfile
You can find lockfile
inside flutter installation directory.
<flutter folder>/bin/cache/lockfile
Remove this file:
<YOUR FLUTTER FOLDER>/bin/cache/lockfile
This releases the occupied lock and makes you able to run other commands.
I have tried all of below steps, but none worked.
Below is the final command that worked for me
rm -rf <flutter_dir>bin/cache/.upgrade_lock