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.


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 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.


How to Install Packet Tracer 6.0.1 for Linux

This article is intended to help me remember the installation process for Cisco Packet Tracer 6 details of which seems to be hard to come by on the web.

1. Log in in to your Cisco Netspace account. Yes, you need to be logged in.
2. The "Download PT 6.0.1" link on is on the NetSpace home page.
3. Click this "Cisco Packet Tracer" link shown below the folder icon as shown in the figure below:

4. Select Cisco Packet Tracer 6.0.1
5. Select download location.
6. After completion of download, use your file manager to open that folder and rename the file to something such as "CPT6". It is a shell script so no file extension is required.
7. Change the file permissions to executable using command: sudo chmod 777 CPT6from a terminal window opened in the download directory. This assumes your downloaded file is renamed CPT6
8. Launch the file with command: ./CPT6 from the terminal window. You will get the message:

Self extracting archive...

Welcome to Packet Tracer 6.0…

Connecting USB 3G Modem to Safaricom in Linux Mint

This particular modem is a ZTE HSUPA MF637U modem. Click on images to see enlarged view. Let's get started:
OS is Linux Mint version 15. Yours may be older or newer.Plug in the modem to a free USB port and check that it recognises the modem as a drive in the File Manager whose icon is shown below third from left and the File Manager view is also shown with the modem listed as the "MODEM-SDSK" drive: Fig. 1. Linux Mint Desktop Panel

Fig 2. Linux Mint File Manager view showing listed drives at left and Application Manu at top. Click on image to see enlarged view.

3. Go to the Applications Menu shown in Fig. 2 and select Settings>Network Connections

Fig. 3. Network Connections dialogue. Click on image to see enlarged view.

4.  Select Add > Mobile Broadband then click  "Create"
5. Follow the wizard to select the device, country, billing plan, service provider and deafult settings.

Fig. 4. Safaricom default settings in Linux Mint. Click on image to see enlar…