解决Android Studio自动更新版本失败的问题

当我们检测android studio是否有最新版本的时候,常常遇到更新失败的问题:Connection failed(connect timed out).Please check network connection and try again。下面给出解决方案:

步骤一:

解决Android Studio自动更新版本失败的问题

进入“C:\Windows\System32\drivers\etc”目录,用记事本打开hosts文件,删除最后两行(红线所圈之处),然后保存(如果因为系统权限问题不能修改文件,可以先将文件复制到桌面,修改后再替换)。

解决Android Studio自动更新版本失败的问题

步骤二:
打开android studio 工程安装目录下的 bin 目录,用记事本打开studio64.exe.vmoptions和studio.exe.vmoptions文件,在文件最后加上以下文字:

-Djava.net.preferIPv4Stack=true

-Didea.updates.url=http://dl.google.com/android/studio/patches/updates.xml

-Didea.patches.url=http://dl.google.com/android/studio/patches/

修改后保存,这下就可以在线更新啦。