android studio镜像设置

android studio需要连网下载sdk,但是因为墙的原因无法连上google。因此需要配置一个镜像。

下面是一些常用的 Android SDK 镜像代理:

清华大学开源软件镜像站:mirrors.tuna.tsinghua.edu.cn/help/AOSP/
阿里巴巴开源镜像站:https://mirrors.aliyun.com/android.googlesource.com/

阿里镜像列表:https://developer.aliyun.com/mirror/

使用镜像代理的步骤如下:

打开 Android Studio,进入 "Settings"(或者 "Preferences")> "Appearance & Behavior" > "System Settings" > "Android SDK"。
在 "SDK Platforms" 选项卡下,选择你需要下载的 Android 版本,在右侧选择一个镜像站点。
在 "SDK Tools" 选项卡下,找到 "Android SDK Build-Tools",选择一个版本,在右侧选择一个镜像站点。
点击 "Apply" 按钮保存更改,然后等待下载和安装完成。
注意,不同的镜像代理可能会有不同的 URL 和配置方式,请根据所使用的镜像代理的指导文档进行相应的设置。

参考

gradle 镜像设置

central
https://maven.aliyun.com/repository/central
https://maven.aliyun.com/nexus/content/repositories/central
https://repo1.maven.org/maven2/
public
https://maven.aliyun.com/repository/public
https://maven.aliyun.com/nexus/content/groups/public
central仓和jcenter仓的聚合仓
gradle-plugin
https://maven.aliyun.com/repository/gradle-plugin
https://maven.aliyun.com/nexus/content/repositories/gradle-plugin
https://plugins.gradle.org/m2/
apache snapshots
https://maven.aliyun.com/repository/apache-snapshots
https://maven.aliyun.com/nexus/content/repositories/apache-snapshots
https://repository.apache.org/snapshots/