title: Pub failed to delete entry because it was in use by another process
body: <p>I was trying to configure my Flutter project to work on the web. I switched to the master channel using <code>flutter channel master</code> after doing this I tried to run <code>flutter upgrade</code>. I am now getting an infinite loop saying:</p>
  <pre><code>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
  </code></pre>
  <p>I have tried multiple things such as running <code>flutter clean</code>, 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 <code>flutter doctor</code>, 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?</p>
  <p>I would appreciate any suggestions on how to fix this.</p>