分享

解决Android Studio更新错误 Solution to connection failure of updating in Android Studio

 joy_chen 2013-08-28

在Google I/O 13里,Google推出了Android Studio。本来这个东西还是挺好的,但是bug满天飞,大部分人尝试装了一下后连编译都过不了,各种解释不通的错误。除了花大量时间搜stack overflow找临时解决办法外,最靠谱的就是等这个工具升级了。

可是由于google在国内的路由可能配置有点问题,每次点Check for update都会出现"Connection failed. Please check your network connection and try again." 这不是一个大坑吗?下面是解决办法。


Win版修改\bin\studio.exe.vmoptions,添加两行

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

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


Mac和Linux版可以直接修改环境变量

$ bin/studio"$ export REQUIRED_JVM_ARGS="-Didea.updates.url=http://dl.google.com/android/studio/patches/updates.xml -Didea.patches.url=http://dl.google.com/android/studio/patches/"


====================================================


It fails to connect when updating Android Studio in the Chinese network. Here is the solution:


For Windows version, append the following two lines to the file "\bin\studio.exe.vmoptions"

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

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


For Mac OSX or Linux versions, directly modify the environment variables

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

$ bin/studio


Reference: 

[1] https://code.google.com/p/android/issues/detail?id=56068


如果不成功:       参考评论1

分别在windows上和mac上尝试了一下以上方法,发现win64系统必须修改\bin\studio64.exe.vmoptions文件方可;而mac上按以上方法依旧不行,后来发现在/Applications/Android Studio.app/bin/idea.vmoptions文件中内容添加如windows上的内容时成功。

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多