I\'m trying to update Android Studio from 0.5.1 to 0.5.2 on two separate Windows machines, one with Windows 7 Pro 64-bit and one with Windows 7 Enterprise 64-bit.
I get
I solved a similar problem while updating Android Studio by just closing all other running applications, such as Firefox and restarted the update process.
It seems that a file is just by another program and it cannot be accessed by Android Studio.
Another way to solve this problem is to delete all files in the corresponding folder, such as: User/AppData/Local/Temp
A workaround:
I realized after a few failed update attempts from 0.5.1 to 0.5.2 that I was no longer getting the Windows security prompt to allow the JetBrains IntellJ installer to proceed, as I had seen in previous successful updates. I'm not sure what changed from previous updates, but apparently the update process was unsuccessfully trying to access files without proper permissions. Elevating Android Studio to admin through the above process fixed the issue.
As noted in the question above, this issue no longer seems to occur with the update from 0.5.2 to 0.5.3.
EDIT
To fix the next error I encountered with the Android 0.6.0 to Android 0.6.1 update, I shut down Studio and then restarted it, and let it sit overnight (more by coincidence than design). When I returned to the machine in the morning and ran the update, it succeeded. So, it seems there is some kind of long running process that blocks the update under certain conditions (likely immediately after startup - possibly the Gradle build process?). @Daniel Wilson's answer below should also work for this scenario.
Whilst running in Admin mode might make the update work, it may also affect the permissions that are set on any files that are added and/or updated, such that future operations in Android studio that use such files will need elevated (Admin) access to work properly.
Doing this will result in many operations not working unless Android Studio has been run in elevated mode.
Try killing all instances of java.exe (in Task Manager or Process Explorer), then re-attempt the update, but not running as Administrator.
Every time I've used Process Explorer (on Windows) to check which application has a lock on one of the files that's blocked an Android Studio update, it's always been Java.
What worked for me (on Windows):
jsch.agentproxy.usocket-nc.jar
, can be checked by pressing Ctl+F, and then entering the file name)Disable antivirus and try update again.... Worked for me.
I used LockHunter to see what was locking the files. Result: Adb had locked some of them (I was testing the application by wifi in a mobile phone). I killed adb server, restart the Android Studio and I was able to update it.
Good luck for others!
I had a Java process running in the background on my Windows machine that wasn't showing up in my Task Manager. This will make sure Java gets killed:
taskkill /F /IM java.exe