Skip to main content

Updating to Android Studio 2.3 - "Cannot delete" file Error

 Updating to Android Studio  2.3 - "Cannot delete" file Error

Android Studio can be a challenging IDE to get going with. Customizing settings, connecting to version control systems, configuring the interface, updating... There are enough sources of headaches to thoroughly demoralize the new developers. Recently, while updating to a new version of Android Studio (2.3) in Windows 10, I came across a very stubborn error that looked like this in the console window:
Cannot delete file C:\Program Files\Android\Android Studio1\gradle\m2repository\com\android\tools\layoutlib\layoutlib-api\24.5.0\layoutlib-api-24.5.0.jar
Unfortunately, the error always appears in the last stage of the update as a patch is being applied. It appears that this stage requires API level 24.5 libraries be deleted and replaced with API 25.2 and 25.3 libraries. Attempting to delete the .jar file [layoutlib-api-24.5.0.jar] manually results in an error saying the file is opened by the Java SE process or some similar process. It means the file is locked and can't be manually deleted.

However, if we could shutdown Java SE process or whatever the offending process, we can unlock the  file. This can be achieved by closing the Java SE using the Task Manager or other command-line tool. To use Task Manager in Windows 10, press the  Ctrl Alt and Del keys all at the same time or Crtl Shift and Esc keys simultaneously. This opens the Task Manager. Look for the offending process. Right-click on it and select the "End Task" popup menu as shown below.



You can now launch Android Studio and select the Help-> Check for Updates menu to check and download updates.

Comments

Popular posts from this blog

How to Install RIOT Plugin for GIMP

How to Install RIOT Plugin for GIMP::  Since this article was first written a stand-alone version of RIOT has been made available Download the plugin from   http://luci.criosweb.ro/riot/download/   Select the download link titled " RIOT as plug-in for other applications "    Launch the  Riot-plugin.exe  file by double clicking. The installer installs all the files including Riot.exe, Riot.dll, and FreeImage.dll in the location where you installed GIMP  If GIMP is open, close it and re-launch it. To optimise an image, open it then save with menu  File->Save for web with RIOT    You can set the target file size by selecting " Compress to size " button  on bottom right corner of optimised image pane and providing the size in kilobytes. Alternatively you can use a slider provided to allow you to change the quality while showing you a preview of the resulting image. Enjoy .       ...

XUBUNTU PANEL AND WINDOW BUTTONS HAVE DISAPEARED

 XUBUNTU PANELS Xubuntu can be quite troublesome when you shutdown and restart. Desktop panels may disappear as well as window minimize/maximise/close buttons.  The panel is equivalent to the Windows 10 Start menu that provides access to applications. TO MAKE THE PANEL REAPPEAR Open a terminal by right-clicking on the desktop then enter the following: xfwm4 --replace TO RECOVER THE PANEL Open a terminal by right-clicking on the desktop then enter the following: xfCE-panel --restart  That is all . As we say in Kiswahili: Mambo kwisha!

Installing NGINX with PHP and MySQL

My OS: Windows 7 Home Premuim 64bit Software Installed: NGINX 0.9.5 for Windows PHP: php-5.3.5-Win32-VC6-x86.zip MySQL: mysql-5.5.9-winx64.msi NGINX Installation Download from  http://nginx.org/en/download.html Unzip into C:\nginx Change the nginx.conf in C:\nginx\conf as per instructions at http://blog.siteroller.net/set-up-nginx-mysql-and-php-wemp-on-windows See my nginx.conf file  here . Note  that in this example, it is assumed that PHP is installed in C:\nginx\php (unzipped into this folder) and MySQl is installed in C:\Program Files\MySQL PHP Installation After downloading the zip version of PHP (V6, threadsafe, zip), unzip into C:\nginx\php\ Rename  php.ini-production  to  php.ini Make changes to this file as given in at  http://blog.siteroller.net/set-up-nginx-mysql-and-php-wemp-on-windows  but do not expect the line numbers given to match exactly. Activate the extensions  extension=php_...