Flutter-AssetsAudioPlayer icon indicating copy to clipboard operation
Flutter-AssetsAudioPlayer copied to clipboard

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

Open richtea99 opened this issue 3 years ago • 9 comments

Hello Florent,

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.

All other libs that I've used work/resolve themselves fine across several Flutter apps - only this one fails. I know that is a generic failure, but I've tried all the usual fixes to work around it, and none have solved it (clearing caches, flutter clean, switching off virus checkers, running pub upgrade from command line, etc).

Lastly, it's not just me with the same problem with assets_audio_player - see here - 6 upticks on the third-ish comment down: https://stackoverflow.com/questions/67578189/pub-failed-to-delete-entry-because-it-was-in-use-by-another-process

Happy to add more details of my dev environment, & test possible solutions for you.

richtea99 avatar Sep 23 '21 14:09 richtea99

pub upgrade gives following error while downloading assests_audio_player

Downloading assets_audio_player 3.0.3+6... 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. pub finished with exit code 1

I have tried all possible things. No luck.

SampathNarayanan avatar Sep 24 '21 01:09 SampathNarayanan

same fix as soon as possible?

mikealphakilo avatar Oct 04 '21 19:10 mikealphakilo

Same here. Downgrading to : 3.0.3+3 solves the issue.

ReversedHourglass avatar Oct 09 '21 21:10 ReversedHourglass

I just had the issue. Run vscode as admin to resolve the problem. For Linux, I think some kind of sudo approach could do the trick.

CabraKill avatar Oct 11 '21 12:10 CabraKill

An update: two steps worked for me. It's not clear if they're linked.

First step: Using the source directly in the project broke the need for an import. Not a good long-term, but it did work as a short-term fix. That's done like this:

  • download the source & drop it into your project (same level as lib)
  • in the 'dev_dependencies' section of pubspec.yaml, add: assets_audio_player:
    path: ./the_audio_sourcecode_directory Rebuild as normal.

Second step: After that I then re-tried the 'flutter pub get' / 'flutter pub upgrade' (can't remember which I ran first) on the command line, but using admin permissions as suggested above by CabraKill. That then worked. It didn't before.

It's not clear why that combination of the two resolved the deletion problem - some weird tool problem? But like I originally said - only this lib has the problem, all my other dependencies were just fine. Doubly weird.

Hopefully the above may get it working for a few more of you. Apart from that, it's a nice lib!

richtea99 avatar Oct 11 '21 14:10 richtea99

MetasImage.network doesn't work with ios any suggestions?!

AbanoubWagih94 avatar Oct 23 '21 15:10 AbanoubWagih94

Open Android Studio with Run as a administration.

ajaysolwin avatar Nov 27 '21 09:11 ajaysolwin

Open Android Studio with Run as a administration.

perfect solution!

xiaoanzi avatar Apr 06 '23 09:04 xiaoanzi