0

Whenever I try to clean my flutter project by using the command flutter clean I get an error saying

Failed to remove build. A program may still be using a file in the directory or the directory itself. To find and stop such a program, see:
https://superuser.com/questions/1333118/cant-delete-empty-folder-because-it-is-used

My app was working fine and then suddenly this happened, tried running cmd as admin and then cleaning but it didn't work, also restarted the cache from the android studio it didn't work either.

SOLUTION FOR ME

I solved the problem by Shutting down any instances of openJDK or java in task manager, than run it within a cmd window with admin privileges.

Emir Kutlugün
  • 63
  • 3
  • 17

1 Answers1

0

Just to summarize, here is a simplified step whenever you've encountered the same issue again:

  1. Open Task Manager and end any java(JDK) related processes.
  2. On Android studio navigate to File -> Invalidate Caches / Restart
  3. Run flutter clean in IDE
MαπμQμαπkγVπ.0
  • 5,887
  • 1
  • 27
  • 65