ci(android): gradle 发行版 + maven 依赖走国内镜像(修 #215 22min 挂)
ci-pangolin / Redline Scan — 脱敏 (UI 文案) (pull_request) Successful in 20s
ci-pangolin / Cleartext Scan — Android 禁明文 (pull_request) Successful in 17s
ci-pangolin / Portable SQL — 可移植性 (mysql/sqlite) (pull_request) Successful in 16s
ci-pangolin / Lint — shellcheck (pull_request) Failing after 7s
ci-pangolin / OpenAPI Sync Check (pull_request) Successful in 12m2s
ci-pangolin / Flutter — analyze + test (pull_request) Successful in 4m19s
ci-pangolin / Golden — 视觉回归 (全量:components/auth/desktop/tablet) (pull_request) Failing after 11m12s
ci-pangolin / Go — integration (mysql/redis testcontainers) (pull_request) Failing after 11m22s
ci-pangolin / E2E Smoke — L4 进程级端到端 (pull_request) Failing after 11m32s
ci-pangolin / Go — build + test (pull_request) Failing after 11m42s
ci-pangolin / DS-flow — 原型/跨端同源/代码色单源闸 (pull_request) Failing after 11m51s
ci-pangolin / Codegen Drift — token 生成物未漂移 (pull_request) Failing after 11m59s

#215 android 跑到 flutter build apk 的 Gradle 阶段挂了 ~17min:
"Gradle threw an error while downloading artifacts from the network"
"java.io.EOFException: SSL peer shut down incorrectly"(org.gradle.wrapper.Download)
——这是 sing-box 之外的第二个 GFW 网络坑:Gradle 要下载发行版和 maven 依赖,
走了被墙的 services.gradle.org / dl.google.com / maven central,SSL 被重置。

env 里配了 GOPROXY/PUB/FLUTTER 镜像,唯独 Gradle+Maven 没配。改:
- gradle-wrapper.properties: distributionUrl → 腾讯云 gradle 镜像(同一份 zip)。
- settings.gradle / build.gradle: repositories 前置阿里云 google/public/gradle-plugin
  镜像,原 google()/mavenCentral()/gradlePluginPortal() 保留作 fallback。

镜像已逐个验证:腾讯 gradle-8.7-bin.zip(206)、阿里云 AGP 8.6.0 pom(200)、
kotlin.android 2.2.0(200)均可取。全球通用,墙内不再依赖被墙源。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A79VtQA1BwTuQN1ThpvYpo
This commit is contained in:
wangjia
2026-07-26 11:15:14 +08:00
parent fc1160ecb3
commit caaed88298
3 changed files with 11 additions and 1 deletions
+3
View File
@@ -1,5 +1,8 @@
allprojects {
repositories {
// 国内镜像优先(见 settings.gradle 同注);原仓库保留作 fallback。
maven { url "https://maven.aliyun.com/repository/google" }
maven { url "https://maven.aliyun.com/repository/public" }
google()
mavenCentral()
}
+3 -1
View File
@@ -2,4 +2,6 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
# 国内镜像:services.gradle.org 被 GFW 墙(SSL 重置),CI runner 在墙内下载发行版会失败。
# 腾讯云 gradle 镜像提供同一份 zip。见 client/android/{settings,build}.gradle 的 maven 镜像同理。
distributionUrl=https\://mirrors.cloud.tencent.com/gradle/gradle-8.7-bin.zip
+5
View File
@@ -10,6 +10,11 @@ pluginManagement {
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
repositories {
// 国内镜像优先(CI runner 在墙内,直连 google/central/gradlePluginPortal 会被 GFW 重置);
// 原仓库保留作 fallback。与 deploy-client.yml 的 GOPROXY/PUB 镜像同理。
maven { url "https://maven.aliyun.com/repository/google" }
maven { url "https://maven.aliyun.com/repository/public" }
maven { url "https://maven.aliyun.com/repository/gradle-plugin" }
google()
mavenCentral()
gradlePluginPortal()