Skip to content

ci: fix Android SDK setup failing on removed tools package - #88

Merged
lhear merged 3 commits into
mainfrom
fix/ci-android-sdk-tools
Oct 27, 2026
Merged

lhear merged 3 commits into
mainfrom
fix/ci-android-sdk-tools

Conversation

@lhear

@lhear lhear commented Oct 27, 2026

Copy link
Copy Markdown
Owner

问题

Set up Android SDK 步骤直接失败:

Warning: Failed to find package 'tools'
Error: The process '/usr/local/lib/android/sdk/cmdline-tools/16.0/bin/sdkmanager' failed with exit code 1

原因

android-actions/setup-android@v3 的默认 packages 是 tools platform-tools,而 tools 包已从 Android SDK 仓库移除,sdkmanager 因此 exit 1,整步失败。

改动

  • setup-android v3 -> v4:默认 packages 改为 platform-tools,且运行于 node24
  • 显式安装 platforms;android-35(compileSdk 35);build-tools 交由 AGP 按自身默认版本补装
  • actions/checkout v4 -> v5、actions/setup-java v4 -> v5,清掉 Node 20 弃用告警

@lhear

lhear commented Oct 27, 2026

Copy link
Copy Markdown
Owner Author

再补一处:SDK 修好后暴露出的第二个失败。

Build Xray-core from Source 在链接阶段失败:

link: github.com/wlynxg/anet: invalid reference to net.zoneCache

Go 1.23 起收紧了 //go:linkname 校验,而 Xray-core 的间接依赖 github.com/wlynxg/anet v0.0.5(已是该库最新版)仍 linkname 到 net.zoneCache。Xray-core 的 go.mod 要求 go 1.27,降 Go 版本不可行,因此在两处 go build 的 ldflags 中加上 -checklinkname=0。

已实跑验证:17 个步骤全部 success,产物 simplexray-apks 共 59.6 MB。

说明:该开关只跳过链接期校验,若将来 Go 真正移除 net.zoneCache,会变成 undefined 报错而不会静默产出坏二进制。

lhear added 3 commits October 27, 2026 16:14
android-actions/setup-android@v3 defaults to packages
'tools platform-tools', but the 'tools' package has been removed from the
SDK repository, so sdkmanager exits 1 and the step fails:

  Warning: Failed to find package 'tools'
  Error: The process '.../sdkmanager' failed with exit code 1

Bump to v4, whose default is only platform-tools (and runs on node24), and
pin the platform/build-tools this project needs explicitly.

Also bump actions/checkout and actions/setup-java to v5 to clear the
"Node.js 20 is deprecated" annotations.
Go 1.23 tightened //go:linkname validation. Xray-core's indirect
dependency github.com/wlynxg/anet v0.0.5 (already the newest release)
still linknames net.zoneCache, so linking the android binary fails:

  link: github.com/wlynxg/anet: invalid reference to net.zoneCache

Disable the check for these builds. Downgrading Go is not an option
because Xray-core's go.mod requires go 1.27.
@lhear
lhear force-pushed the fix/ci-android-sdk-tools branch from 3b8f25d to 474ac9e Compare October 27, 2026 08:14
@lhear
lhear merged commit 3da8b35 into main Oct 27, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant