Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not delete path

I have been facing these "Could not delete path" problems for months.

To run my application, I always have to delete all my app/build files. But it is very time-consuming.

Sometimes i have to restart android studio for run my application.

Tried clean project and run. Tried clean project, build project and run. tried Invalidates caches / restart also but my app didn't run until i clear that project build folder.

These are the errors I am getting alternatively.

enter image description here

enter image description here

enter image description here

enter image description here

Can I reinstall Android Studio to solve this or is there a solution to get rid of it?

like image 317
sushildlh Avatar asked Jul 19 '18 10:07

sushildlh


3 Answers

You cannot delete a file or folder because it is locked by another program.

First You should check out what program is causing the problem. On superuser.com there is already related topic and there is also a solution with step to step how to do it.

I used to use Process Explorer to resolve the problem.

like image 63
deadfish Avatar answered Oct 22 '22 22:10

deadfish


you may not have permission to use the folder project try one of this solutions (maybe because of some antivirus apps or OS permissions):

  1. copy project file to another place that you are sure to have read/write permission and open that new project folder in android studio

  2. run android studio as administrator

  3. right click on project folder and get read and write permissions to your username.

like image 25
ygngy Avatar answered Oct 22 '22 23:10

ygngy


Most easy way to get unlock file.

  1. Download LOCKHUNTER and install in your system.

  2. Close your android studio and select your Android studio from your system drive.

  3. Select your folder, so you will get which all files is locked like image below.

enter image description here

  1. Select all and Unlock BUTTON in application.

  2. It will restart your application and have fun with android studio.

like image 31
sushildlh Avatar answered Oct 22 '22 22:10

sushildlh