Waiting for another flutter command to release the startup lock

后端 未结 30 3159
暗喜
暗喜 2020-12-12 09:20

When I run my flutter application it show

Waiting for another flutter command to release the startup lock

this messages and not

相关标签:
30条回答
  • 2020-12-12 10:07

    You can try to all flutter processes.

    TL;DR - go to point 4)

    1) List of the processes:

    ps aux
    

    2) Search name containing with 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
    

    3) Get processes ID

    We need content from second column (from above output):

    ps aux | grep flutter | awk '{print $2}'
    

    4 a) Kill "automatically":

    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
    

    4 b) Kill manually

    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.

    0 讨论(0)
  • 2020-12-12 10:07

    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.

    0 讨论(0)
  • 2020-12-12 10:08

    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.

    0 讨论(0)
  • 2020-12-12 10:09

    1. Stop all running dart instances

    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
    

    2. Remove lockfile

    You can find lockfile inside flutter installation directory.

    <flutter folder>/bin/cache/lockfile
    
    0 讨论(0)
  • 2020-12-12 10:10

    Remove this file:

    <YOUR FLUTTER FOLDER>/bin/cache/lockfile
    

    This releases the occupied lock and makes you able to run other commands.

    0 讨论(0)
  • 2020-12-12 10:10

    I have tried all of below steps, but none worked.

    1. Delete lockfile;
    2. Run killall -9 dart;
    3. Restart my PC.

    Below is the final command that worked for me

    rm -rf <flutter_dir>bin/cache/.upgrade_lock
    
    0 讨论(0)
提交回复
热议问题