V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
michaelye1988
V2EX  ›  问与答

Android Studio 环境搭建问题

  •  
  •   michaelye1988 · 2014-11-06 15:49:21 +08:00 · 19138 次点击
    这是一个创建于 3465 天前的主题,其中的信息可能已经有所发展或是发生改变。
    应该是被墙了,在新建项目的过程中提示:

    Loading SDK information...
    Refresh Sources:
    Failed to fetch URL https://dl-ssl.google.com/android/repository/addons_list-2.xml, reason: hostname in certificate didn't match: <dl-ssl.google.com> != <www.google.com>; OR <www.google.com>;
    Fetched Add-ons List successfully
    Refresh Sources
    Failed to fetch URL https://dl-ssl.google.com/android/repository/repository-10.xml, reason: SSL hostname in certificate didn't match: <dl-ssl.google.com> != <www.google.com>; OR <www.google.com>;
    Refresh Sources:
    Failed to fetch URL https://dl-ssl.google.com/android/repository/repository-10.xml, reason: SSL hostname in certificate didn't match: <dl-ssl.google.com> != <www.google.com>; OR <www.google.com>;
    There is nothing to install or update.


    搜索了一下很多人有这个问题,但是目前搜索到的解决方案都不行。
    第 1 条附言  ·  2014-11-06 16:40:50 +08:00
    工程是能顺利新建的,但是不能编译,也不能运行,提示failed to sync Gradle project'xxx' failed to find build Tools revision 19.1.0

    但是sdk里面以及下载好了19.1.0
    第 2 条附言  ·  2014-11-06 18:19:03 +08:00
    解决了,求人不如求己。
    解决方法:Android Studio下载的地方显示包含了sdk,但是下载后却没有看到sdk在哪里。打开的时候需要关联一个sdk,这时候问题来了。我关联的是旧版本的sdk,这个时候,到官网下载eclipse的开发环境,里面有sdk,关联该sdk,就可以正常使用了。
    6 条回复    2014-11-17 12:48:48 +08:00
    marvinlix
        1
    marvinlix  
       2014-11-06 16:23:17 +08:00
    要翻墙下载sdk
    bubbles
        2
    bubbles  
       2014-11-06 16:27:15 +08:00
    其实用http代理就可以,找一个速度可以的还是很快的。
    Culm
        3
    Culm  
       2014-11-06 16:29:02 +08:00
    每次看到楼主这类头像,我就不想承认我做过android
    michaelye1988
        4
    michaelye1988  
    OP
       2014-11-06 16:38:39 +08:00
    @marvinlix
    @bubbles 是这样的,我在本地已经有sdk了(Eclipse在用的),然后今天下载Android Studio,里面指定了sdk的目录,和Eclipse共用一个sdk,但是,这几个文件一直无法下载下来,通过sdk Manager下载sdk是没有问题的。可是在新建工程的时候老是会提示这个。不知道这什么意思。
    332781100
        5
    332781100  
       2014-11-16 11:12:50 +08:00   ❤️ 1
    我用了vpn都不行,奇怪的是,我用浏览器访问那个Failed to fetch URL,可以访问到。然后我在看看错误信息。reason: hostname in certificate didn't match: <dl-ssl.google.com> != <www.google.com>; OR <www.google.com>。证书中的hostname不匹配。然后猜想,以前用eclipse的时候sdk update修改了windows下面的host文件,把host下的
    203.208.46.146 dl.google.com
    203.208.46.146 dl-ssl.google.com
    注释掉,然后打开vpn更新,可以了。
    btw:android studio编程真的很有快感,不过同时bug也挺多的
    michaelye1988
        6
    michaelye1988  
    OP
       2014-11-17 12:48:48 +08:00
    @332781100 恩,是这样的,Eclipse也留着,以备不时之需,哈哈
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2179 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 05:02 · PVG 13:02 · LAX 22:02 · JFK 01:02
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.