Fix #537: stop installing the deprecated tools package

Google no longer serves the `tools` package: it is gone from
repository2-3.xml, so `sdkmanager tools` fails with
"Failed to find package 'tools'" and takes the whole action down with it.

- Drop `tools` from the default value of the `packages` input, leaving
  `platform-tools`. The command line tools that replaced it are already
  installed by this action, and there is no bare `cmdline-tools` package
  path to install instead (only versioned ones, e.g. `cmdline-tools;20.0`).
- Skip `tools` with a warning when it is requested explicitly, so the
  many workflows that pass `packages: 'tools platform-tools'` keep working
  instead of failing.
- Update the README accordingly.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Volodymyr
2026-09-17 11:39:35 -05:00
committed by Vilius Sutkus '89
co-authored by Claude Opus 5
parent 4d90f94363
commit 7731365548
4 changed files with 50 additions and 4 deletions
+13
View File
@@ -175,6 +175,19 @@ async function run(): Promise<void> {
.filter(function (element, index, array) {
return element
})
.filter(function (pkg) {
// The 'tools' package is deprecated and no longer served by Google,
// asking sdkmanager for it fails the whole action.
// Its replacement, cmdline-tools, is already installed by this action.
if (pkg === 'tools') {
core.warning(
"Skipping deprecated package 'tools', it is no longer available in the Android SDK repository. " +
'The command line tools installed by this action replace it, see https://developer.android.com/tools#tools-sdk'
)
return false
}
return true
})
for (const pkg of packages) {
await callSdkManager(sdkManagerExe, pkg)
}