Android Studio 3.0: Unable to delete file

Viewed 12935

Android Studio 3.0

classpath 'com.android.tools.build:gradle:3.0.0'

Sometimes when I try to start app I get the next error:

Error:java.io.IOException: Unable to delete file: myproject\common\build\intermediates\intermediate-jars\debug\classes.jar
> Unable to delete file: myproejct\common\build\intermediates\intermediate-jars\debug\classes.jar

The proccess java.exe lock this. Why?

3 Answers

You need to go to the source file directly. Close the studio or the project and go to the path the issue is located at and delete the folder there.

If this doesn't work try Go to the File> Settings> Build,Execution,Deployment> Instant Run > Uncheck this Check box (Enable Instant Run)

And then gradlew clean in the console

Try running android studio as Administrator, right click on the Android studio shortcut then "run as administrator"

Try to disable the Instant Run

Preferences > Build, Execution, Deployment > Instant Run

Related