Skip to content

Commit dcc77d8

Browse files
committed
docs: 补充Android Studio gradle timeout内容
1 parent e6cb693 commit dcc77d8

File tree

8 files changed

+1227
-1014
lines changed

8 files changed

+1227
-1014
lines changed

.vitepress/config/sidebar/android-faq.sidebar.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ export function androidFaqSidebar() {
55
items: [
66
{
77
text: '替换库文件AAR/jar不起作用?',
8-
link: '/android/faq/android-faq-aar-not-work/',
8+
link: '/android/faq/android-studio-aar-not-work/',
99
},
1010
{
1111
text: 'gradle构建超时read time out?',
12-
link: '/android/faq/android-faq-android-studio-read-time-out',
12+
link: '/android/faq/android-studio-gradle-timeout/',
1313
},
1414
],
1515
},

.vitepress/config/theme.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export const themeConfig: DefaultTheme.Config = {
6767
},
6868
{
6969
text: 'Android开发FAQ',
70-
link: '/android/faq/android-faq-aar-not-work/',
70+
link: '/android/faq/android-studio-aar-not-work/',
7171
activeMatch: '/android/faq/*',
7272
},
7373
],
Loading
Loading

android/faq/android-faq-android-studio-read-time-out.md android/faq/android-studio-gradle-timeout/index.md

+18-6
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
---
2-
title: "Android开发常见问题:Android Studio[read time out]解决方法"
3-
date: "2023-10-19"
2+
title: 'Android开发常见问题:Android Studio gradle timeout 解决方法'
3+
date: '2023-10-19'
44
categories:
5-
- Android开发
5+
- Android开发
66
tags:
7-
- Android开发常见问题
7+
- Android开发常见问题
88
---
9-
因为在多平台开发,经常会重新拉取代码,或者更新依赖,在`gradle`构建的时候,会出现`read time out`的报错,在中国区有时候挂VPN也不好使,这时候可以试试设置阿里云代理,如下:
9+
10+
因为在多平台开发,经常会重新拉取代码,或者更新依赖,在`gradle`构建的时候,会出现`read time out`的报错,在中国区有时候挂 VPN 也不好使,这时候可以试试设置阿里云代理,如下:
1011
::: code-group
12+
1113
```kotlin [Kotlin]
1214
pluginManagement {
1315
repositories {
@@ -34,6 +36,7 @@ dependencyResolutionManagement {
3436
}
3537
}
3638
```
39+
3740
```groovy [Groovy]
3841
buildscript {
3942
repositories {
@@ -75,5 +78,14 @@ allprojects {
7578
}
7679
7780
```
81+
7882
:::
79-
<!--more-->
83+
84+
## 配置 Proxy 代理
85+
86+
如果更改了库源还是不行,可以试试配置 Android Studio 的代理设置,打开设置选项,搜索`proxy`,设置如下图:
87+
![android-gradle-timeout-proxy-setting](android-gradle-timeout-proxy-setting.png)
88+
具体设置的`host`需要根据每个人的 VPN 配置,比如在 MacOS 上,如果是**Clash**,可以点击`Copy shell command`,复制指令到终端查看 IP 端口信息内容:
89+
![android-gradle-timeout-vpn](android-gradle-timeout-vpn.png)
90+
91+
<!--more-->

0 commit comments

Comments
 (0)