I’m trying to update Android Studio 4.1.2 to 2020.3.1, update fails and suggest to read idea_updater.log
. Here’s the dialog box prompted during update:
The only relevant error I can found is this one:
03/08 13:57:57 INFO DeleteAction.doApply - Delete action. File: C:Program FilesAndroidAndroid Studiojrejrebin
03/08 13:57:57 INFO DeleteAction.doApply - Delete: C:Program FilesAndroidAndroid Studiojrejrebin
03/08 13:57:57 ERROR Patch.apply - apply failed
java.io.IOException: Cannot delete: C:Program FilesAndroidAndroid Studiojrejrebin
at com.intellij.updater.Utils.tryDelete(Utils.java:115)
at com.intellij.updater.Utils.access$000(Utils.java:12)
at com.intellij.updater.Utils$1.postVisitDirectory(Utils.java:77)
at com.intellij.updater.Utils$1.postVisitDirectory(Utils.java:68)
at java.nio.file.Files.walkFileTree(Files.java:2688)
at java.nio.file.Files.walkFileTree(Files.java:2742)
at com.intellij.updater.Utils.delete(Utils.java:68)
at com.intellij.updater.DeleteAction.doApply(DeleteAction.java:71)
at com.intellij.updater.PatchAction.apply(PatchAction.java:213)
at com.intellij.updater.Patch.lambda$apply$3(Patch.java:406)
at com.intellij.updater.Patch.forEach(Patch.java:454)
at com.intellij.updater.Patch.apply(Patch.java:399)
at com.intellij.updater.PatchFileCreator.apply(PatchFileCreator.java:116)
at com.intellij.updater.Runner.install(Runner.java:381)
at com.intellij.updater.Runner._main(Runner.java:180)
at com.intellij.updater.Runner.main(Runner.java:41)
Caused by: java.nio.file.FileSystemException: C:Program FilesAndroidAndroid Studiojrejrebin: Impossibile accedere al file. Il file รจ utilizzato da un altro processo.
at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:86)
at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:97)
at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:102)
at sun.nio.fs.WindowsFileSystemProvider.implDelete(WindowsFileSystemProvider.java:273)
at sun.nio.fs.AbstractFileSystemProvider.delete(AbstractFileSystemProvider.java:103)
at java.nio.file.Files.delete(Files.java:1126)
at com.intellij.updater.Utils.tryDelete(Utils.java:89)
... 15 more
it seems that it’s unable to remove C:Program FilesAndroidAndroid Studiojrejrebin
folder since it’s locked from another process.
At the moment the error dialog appear the folder cited above is empty (before update holds 55 files and 3 folders).
But AFAIK there are not other processes trying to use any resource in Android Studio while the update is running.
Tried several times with the same result. Any hints? Should I remove Android Studio and try a fresh new install?
2
Answers
I've not been able to find any lock on such folder. I needed to uninstall 4.1.2 and reinstall 2020.3.1 (everything worked).
Download a fresh JRE and install it to another folder NOT below your android studio folder
for latest openJDK as of date (my favorite), download it here
restart windows in safe mode
delete the c:program filesandroidandroid studiojre and its subfolders
restart windows to normal mode
run Android studio and pick the fresh JRE folder you’ve just installed
try the update again