Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pub failed to delete entry because it was in use by another process

Tags:

flutter

dart

I was trying to configure my Flutter project to work on the web. I switched to the master channel using flutter channel master after doing this I tried to run flutter upgrade. I am now getting an infinite loop saying:

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

I have tried multiple things such as running flutter clean, trying to change back to the stable channel, deleting the cache folder in the flutter/bin directory, turning off my windows defender, nothing seems to work. Now when I try to run flutter doctor, or any other flutter command, I get the same infinite loop with the same message. I have also tried manually downloading and replacing my flutter sdk installation with a new installation, this did not work either. Is my only option at this point to delete flutter completely and reinstall from scratch?

I would appreciate any suggestions on how to fix this.

like image 611
Alexis Acosta Avatar asked May 17 '21 23:05

Alexis Acosta


1 Answers

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.

like image 74
aeviou Avatar answered Nov 18 '22 20:11

aeviou