问题描述
我想从0.5.1更新Android的工作室到0.5.2在两个单独的Windows机器,一是与Windows 7专业版64位和一个与Windows 7企业版64位。
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 the normal update prompt:
...如果我选择更新并重新启动,该补丁的下载和IDE退出,但后来我得到如下对话框:
...and if I choose "Update and Restart", the patch downloads and the IDE exits, but then I get the following dialog:
我不能改变任何解决方案列项。如果我点击继续,我得到以下信息,如下图所示(图片和文字,所以它的复制/粘贴/搜索友好):
I can't change any of the "Solution" column entries. If I click "Proceed", I get the following message as shown below (image and text, so its copy/paste/search-friendly):
Temp. directory: C:\Users\Sean\AppData\Local\Temp\
java.io.FileNotFoundException: C:\Program Files (x86)\Android\android-studio\lib\jsch.agentproxy.usocket-nc.jar (Access is denied)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(FileOutputStream.java:221)
at java.io.FileOutputStream.<init>(FileOutputStream.java:171)
at com.intellij.updater.Utils.copyStreamToFile(Utils.java:135)
at com.intellij.updater.CreateAction.doApply(CreateAction.java:52)
at com.intellij.updater.PatchAction.apply(PatchAction.java:140)
at com.intellij.updater.Patch$3.forEach(Patch.java:198)
at com.intellij.updater.Patch.forEach(Patch.java:248)
at com.intellij.updater.Patch.apply(Patch.java:194)
at com.intellij.updater.PatchFileCreator.apply(PatchFileCreator.java:86)
at com.intellij.updater.PatchFileCreator.apply(PatchFileCreator.java:77)
at com.intellij.updater.Runner.doInstallImpl(Runner.java:307)
at com.intellij.updater.Runner.doInstall(Runner.java:268)
at com.intellij.updater.Runner.access$000(Runner.java:18)
at com.intellij.updater.Runner$2.execute(Runner.java:258)
at com.intellij.updater.SwingUpdaterUI$7.run(SwingUpdaterUI.java:230)
at java.lang.Thread.run(Thread.java:744)
当我点击退出,机器人工作室重新打开,并告诉我,更新仍然可用。
When I click "Exit", Android Studio re-opens, and tells me that the update is still available.
我已经更新的Android工作室previously使用在两台机器上同样的方法不会有问题。
I've updated Android Studio previously using this same method on both machines without a problem.
因为我相信这是某种形式的bug与Android工作室具体到新版本,我已经打开的在AOSP问题跟踪器。
Since I believe this is some kind of bug with Android Studio specific to newer releases, I've opened Issue 67794 on the AOSP issue tracker.
修改
我能够从0.5.2到0.5.3今天在两台机器上更新,而不会遇到这个问题。我被Windows安全提示JetBrains的安装程序在previous成功更新,更新成功完成无我不必启动的Android工作室提升的权限。因此,看来问题是一些具体的事情到0.5.1或0.5.2的补丁。
I was able to update from 0.5.2 to 0.5.3 today on both machines without encountering this issue. I was shown the Windows security prompt for the JetBrains installer as in previous successful updates, and update completed successfully without me having to start Android Studio with elevated permissions. So, seems the problem was something specific to 0.5.1 or 0.5.2 patches.
修改
我遇到试图更新从Android的工作室0.6.0到0.6.1时,类似的错误:
I encountered a similar error when trying to update from Android Studio 0.6.0 to 0.6.1:
温度。目录:C:\用户\巴博\应用程序数据\本地\ TEMP \
+ ---------------- 一个文件操作失败。 这可能是由于被锁定由另一个文件 应用。请尝试关闭所有应用 使用正在更新的文件,那么preSS重试。 + ----------------
+---------------- A file operation failed. This might be due to a file being locked by another application. Please try closing any application that uses the files being updated then press 'Retry'. +----------------
com.intellij.updater.RetryException:无法删除文件:C:\ Program Files文件(x86)的\机器人\ Android的studio1 \ LIB \ openapi.jar 在com.intellij.updater.BaseUpdateAction.replaceUpdated(BaseUpdateAction.java:40) 在com.intellij.updater.UpdateZipAction.doApply(UpdateZipAction.java:199) 在com.intellij.updater.PatchAction.apply(PatchAction.java:140) 在com.intellij.updater.Patch $ 3.forEach(Patch.java:198) 在com.intellij.updater.Patch.forEach(Patch.java:248) 在com.intellij.updater.Patch.apply(Patch.java:194) 在com.intellij.updater.PatchFileCreator.apply(PatchFileCreator.java:86) 在com.intellij.updater.PatchFileCreator.apply(PatchFileCreator.java:77) 在com.intellij.updater.Runner.doInstallImpl(Runner.java:307) 在com.intellij.updater.Runner.doInstall(Runner.java:268) 在com.intellij.updater.Runner.access $ 000(Runner.java:18) 在com.intellij.updater.Runner $ 2.execute(Runner.java:258) 在com.intellij.updater.SwingUpdaterUI $ 7.run(SwingUpdaterUI.java:230) 在java.lang.Thread.run(Thread.java:745)
com.intellij.updater.RetryException: Cannot delete file C:\Program Files (x86)\Android\android-studio1\lib\openapi.jar at com.intellij.updater.BaseUpdateAction.replaceUpdated(BaseUpdateAction.java:40) at com.intellij.updater.UpdateZipAction.doApply(UpdateZipAction.java:199) at com.intellij.updater.PatchAction.apply(PatchAction.java:140) at com.intellij.updater.Patch$3.forEach(Patch.java:198) at com.intellij.updater.Patch.forEach(Patch.java:248) at com.intellij.updater.Patch.apply(Patch.java:194) at com.intellij.updater.PatchFileCreator.apply(PatchFileCreator.java:86) at com.intellij.updater.PatchFileCreator.apply(PatchFileCreator.java:77) at com.intellij.updater.Runner.doInstallImpl(Runner.java:307) at com.intellij.updater.Runner.doInstall(Runner.java:268) at com.intellij.updater.Runner.access$000(Runner.java:18) at com.intellij.updater.Runner$2.execute(Runner.java:258) at com.intellij.updater.SwingUpdaterUI$7.run(SwingUpdaterUI.java:230) at java.lang.Thread.run(Thread.java:745)
这似乎发生,如果您尝试运行更新,而摇篮建设进程仍在运行(如,右后启动了Android的工作室)。
This seems to happen if you try to run the update while the Gradle build process is still running (e.g., right after you start up Android Studio).
推荐答案
一个解决方法:
- 关闭Android的工作室。
- 右键点击机器人工作室图标,选择以管理员身份运行。
- 进入帮助 - >检查更新...,并通过正常的更新过程
我意识到,经过几次失败的更新尝试从0.5.1到0.5.2,我不再让Windows安全提示,让JetBrains的IntellJ安装程序来进行,就像我在previous成功更新见过。我不知道从$ P $什么改变pvious更新,但显然在更新过程中失败尝试访问文件没有适当的权限。升降机器人工作室为admin通过上述方法固定的问题。
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.
如在上面的问题指出,这个问题似乎不再发生与来自0.5.2至0.5.3更新
As noted in the question above, this issue no longer seems to occur with the update from 0.5.2 to 0.5.3.
修改
要解决的下一个错误我了Android 0.6.0遇到到Android 0.6.1更新,我关闭工作室,然后重新启动它,并让它坐过夜(巧合比设计更)。当我在早晨回到了机器运行的更新,它成功了。因此,似乎有某种长期运行的进程,阻止在一定条件下的更新(可能启动后 - 可能是摇篮建立过程?)。下面@Daniel威尔逊的答案也应该适用于这种情况。
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.
这篇关于无法更新Android的工作室 - 访问被拒绝,并java.io.FileNotFoundException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!