Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter cannot delete build folder when flutter clean is executed

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

I can understand that there is some directory opened and it has to closes in order to clean. But I cannot understand which one is it. I tried restarting my computer to resolve this issue. But still when I run the command flutter clean I get the error.

like image 948
Jithin Pal Avatar asked Dec 28 '19 12:12

Jithin Pal


People also ask

How do I delete the build folder in flutter?

To clear Flutter's Build cache Open your flutter project folder in Command Prompt or Terminal. Then type flutter clean command and press enter. After executing flutter clean command we would see that it will delete the dart-tools folder, android folder and iOS folder in our application with debug file.

How do I get rid of Project flutter?

In your terminal hit flutter clean command , after that hit flutter pub get . Your all apk's will be delete.

How do you clear the console in flutter?

So there are two ways you can solve this problem. 1- Restart visual studio code (it will automatically close the terminals) 2- Stop the terminal in which flutter project is already running and then run flutter clean command. Show activity on this post.


Video Answer


2 Answers

If you moved your project folder to another place then just **delete** your "build" folder and

flutter clean

and

flutter pub get

you will be fine:) Cheers.

like image 113
imssurya Avatar answered Oct 20 '22 04:10

imssurya


Simply run your cmd as administrator then run the command. As simple as that.

Thank me later.. :)

like image 8
Talha Shahab Avatar answered Oct 20 '22 06:10

Talha Shahab