문제 설명
다른 프로세스에서 사용 중이기 때문에 Pub에서 항목을 삭제하지 못했습니다. (Pub failed to delete entry because it was in use by another process)
웹에서 작동하도록 Flutter 프로젝트를 구성하려고 했습니다. 이 작업을 수행한 후 flutter channel master
를 사용하여 마스터 채널로 전환했습니다. flutter upgrade
를 실행하려고 했습니다. 이제 다음과 같은 무한 루프가 발생합니다.
Building flutter tool...
Running pub upgrade...
Pub failed to delete entry because it was in use by another process.
This may be caused by a virus scanner or having a file
in the directory open in another application.
Error (1): Unable to 'pub upgrade' flutter tool. Retrying in five seconds... (9 tries left)
Waiting for 0 seconds, press CTRL+C to quit ...
Running pub upgrade...
Pub failed to delete entry because it was in use by another process.
This may be caused by a virus scanner or having a file
in the directory open in another application.
Error (1): Unable to 'pub upgrade' flutter tool. Retrying in five seconds... (8 tries left)
Waiting for 2 seconds, press CTRL+C to quit ...
Terminate batch job (Y/N)? Y
flutter clean
실행, 안정적인 채널로 다시 변경, 캐시 폴더 삭제와 같은 여러 가지를 시도했습니다. flutter/bin 디렉토리, 내 Windows Defender를 끄면 아무 것도 작동하지 않는 것 같습니다. 이제 flutter Doctor
또는 다른 flutter 명령을 실행하려고 하면 동일한 메시지와 함께 동일한 무한 루프가 발생합니다. 또한 수동으로 flutter sdk 설치를 다운로드하여 새 설치로 교체하려고 시도했지만 작동하지 않았습니다.
참조 솔루션
방법 1:
I ran my compiler as an administrator, and it worked for me. Open your Android Studio or Visual Studio as an admin.
방법 2:
I was running into this issue and discovered that the problem was a new dependency that I added. In my case it was assets_audio_player: ^3.0.3+1
, but of course it could be any dependency. Deleting it immediately fixed my problem.
방법 3:
Faced this problem and had to run "start ms‑settings:developers" at terminal. It solved the issue.
방법 4:
On windows: Run vscode, or the terminal you are using, as admin to resolve the problem. For Linux: I think some kind of sudo approach could do the trick.
방법 5:
run flutter upgrade in an external admin cmd console
(by Alexis Acosta、Ilidio Nzage、aeviou、J.Koriya、Raphael Souza、MuscleNerd)