OS version: Ubuntu 14.04 LTE 64 Bit
Java JRE/JDK version: Oracle JDK 1.8.0_11
Project directory is on a NTFS based drive.
Whenever I try to clean my
You can go into the project directory and call gradle from the command-line to do a clean on the project:
gradlew clean
When you reopen the project you will need to run a gradle sync again.
I'm not on Windows, but OS X. Somehow my build folder didn't have the proper permission for AS to delete the file so I did chmod -R 777 <your_directory>
in the affected parent directory.. probably 777 isn't what you would want but it worked for me.
I had the same issue as you. I tried some of the solutions proposed on this page and it didn't work. So I used Process Explorer to find which process is locking the apk file and it was firefox. I think it keeps the file locked when I upload the apk in google play console. To make that go to "Find > Find Handle or DLL... > path-to-your-app.apk". Hope it help
Running android studio as administrator in windows worked for me. :)
Go to
File > Settings > Build, Execution, Deployment > Instant Run > Uncheck this Check box (Enable Instant Run to hot swap code)
Thanks Have a nice coding
I came to this thread because I was having issues with my /release/app.aab getting locked. This prevented me from completing a project clean and generating a signed bundle. My work around was to restart my computer to get permissions back until I solved the issue.
It turns out that Git was locking the app.aab, and all I had to do was add "/release" to my /app/.gitignore.
Hope this helps someone.