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

空扰寡人 提交于 2019-12-08 11:58:02

问题


I've been trying to upgrade Android Studio from 1.5.1 to 2.1.2 and it keeps giving me the java.io.FileNotFoundException, and that "(The requested operation cannot be performed on a file with a user-mapped section open)".

(see below)

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)

Please help!

*Note: I'm on Windows 7.


回答1:


I think its too late to answer this. I faced this problem some time back and solved it just by disabling real-time protection of Windows Defender. What happens here is system protection tools (antivirus, windows defender etc) deletes the necessary installation files causing this trouble.

To disable Windows defender:

  1. Go to control panel (Run -> control )
  2. From Control Panel\All Control Panel Items find out and launch Windows Defender (Alternatively you can check this link how to run it direct from command line)
  3. In Windows Defender go to Settings->Real-time protection
  4. Check off "Turn on real-time protection"

Now run the upgrade again. It will go through successfully. Once done with upgrade, turn on real-time protection again.

If not Windows Defender, you can try turning off antivirus protection at the time of upgrade.

Hope this helps.




回答2:


Answer from @atul is correct, however, I am adding settings if you have installed "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.

In order to overcome the problem once for all you need to add your Android project in the excluded list, images for description below

Step 1: Go to Microsoft Security Essentials

Step 2: Click on "Exclude files and locations"

and click over "Browse" to select Android project folder

Step 3: Click "Add" and "Save Changes"

Note: This setting may leave your project folder prone to unknown viruses.



来源:https://stackoverflow.com/questions/37768938/android-studio-1-5-1-to-2-1-2-failed-to-apply-patch-filenotfoundexception

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!