You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Ubuntu下SDK包安装失败及Android Studio SDK下载超时问题求助

解决Ubuntu下Android Studio安装Android Support Repository超时问题

Hey, I've run into this exact timeout issue when installing Android SDK packages on Ubuntu before—let me walk you through the fixes that worked for me and other devs:

1. 手动下载并放置SDK包

The root problem here is that the large zip file times out during automatic download. Instead, grab it manually:

  • Open your terminal and run this command to download the package directly:
    wget https://dl.google.com/android/repository/android_m2repository_r47.zip
    
    Or use your browser to download it if you prefer—just make sure the download completes fully (no corrupted files).
  • Next, find your SDK location in Android Studio: go to File > Settings > Appearance & Behavior > System Settings > Android SDK to get the path.
  • Navigate to the temp folder inside your SDK directory (create it if it doesn't exist) and move the downloaded zip there. Alternatively, extract the zip and copy all its contents to extras/android/m2repository (create this directory structure if it's missing).

2. 调整Android Studio的超时与网络设置

Sometimes the default timeout is too short for large files, or IPv6 causes connectivity glitches:

  • Open Help > Edit Custom VM Options in Android Studio. Add these lines to the file:
    -Djava.net.preferIPv4Stack=true
    -Dhttp.connection.timeout=100000
    -Dhttp.socket.timeout=100000
    
    The first line forces IPv4 (avoids IPv6-related drops), and the next two increase the timeout to 100 seconds (adjust if needed).
  • Save the file and restart Android Studio, then try installing the SDK again.

3. 检查代理配置

If you're on a network that uses a proxy, double-check your settings:

  • Go to File > Settings > Appearance & Behavior > System Settings > HTTP Proxy.
  • If you need a proxy, select the correct type (HTTP/HTTPS) and enter the correct address/port, then click Check connection to verify it works.
  • If you don't use a proxy, make sure No proxy is selected, and clear any old proxy cache.

4. 切换到国内镜像源(针对国内开发者)

If you're in a region where Google's servers are slow, try a domestic mirror:

  • In SDK Manager, go to the SDK Update Sites tab.
  • Click the + button to add a mirror like http://mirrors.aliyun.com/android/repository/, then uncheck the original Google repositories.
  • Refresh the package list and try installing again—just ensure the mirror has the android_m2repository_r47.zip package available.

If none of these work, try restarting your router or waiting a bit—sometimes it's just a temporary network blip causing the timeout.

内容的提问来源于stack exchange,提问作者benyamin nadri

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.26 09:26:06