Android Studio(1.5.1 到 2.1.2)应用补丁失败(FileNotFoundException)

Android Studio (1.5.1 to 2.1.2) failed to apply patch (FileNotFoundException)

我一直在尝试将 Android Studio 从 1.5.1 升级到 2.1.2,它一直给我 java.io.FileNotFoundException,并且“(请求的操作无法在打开用户映射部分的文件)"。

(见下文)

java.io.FileNotFoundException: C:\Users\name\.AndroidStudio1.5\system\log\idea.updater.files.tmp.0\temp.tmp.1\gradle\gradle-2.8\docs\dsl\org.gradle.api.plugins.ApplicationPluginConvention.html (The requested operation cannot be performed on a file with a user-mapped section open)

请帮忙!

*注意:我在Windows 7.

我想现在回答这个问题已经太晚了。前段时间我遇到了这个问题,只是通过禁用 Windows Defender 的实时保护来解决它。这里发生的是系统保护工具(防病毒、windows 防御者等)删除了导致此问题的必要安装文件。

要禁用 Windows 防御者:

  1. 转到控制面板(运行 -> 控制)
  2. 从控制 Panel\All 控制面板项找到并启动 Windows Defender(或者你可以检查 this link 如何 运行 它直接从命令行)
  3. 在Windows Defender 中进入设置->实时保护
  4. 勾选"Turn on real-time protection"

现在运行再次升级。它将顺利通过。升级完成后,再次开启实时保护。

如果没有WindowsDefender,您可以尝试在升级时关闭杀毒保护。

希望对您有所帮助。

@atul 的回答是正确的,但是,如果您安装了 "Windows Security Essentials"

,我将添加设置

You can change settings in Microsoft Security Essentials and turn off "Real-time" protection but it will cause the same error if turned on again.

为了一劳永逸地解决这个问题,您需要将您的Android项目添加到排除列表中,图片说明如下

第 1 步:转到 Microsoft Security Essentials

第 2 步:点击 "Exclude files and locations"

然后单击 "Browse" 到 select Android 项目文件夹

第 3 步:单击 "Add" 和 "Save Changes"

注意:此设置可能会使您的项目文件夹容易感染未知病毒。