ci(android): pre-install NDK with retry to fix corrupt-zip flake#150
Merged
Conversation
The instrumented-tests job removes all pre-installed NDKs, so Gradle
auto-downloaded the required NDK mid-build with no retry. That single-shot
sdkmanager download occasionally fetched a corrupt archive ("Error on
ZipFile unknown archive"), failing the build before any test ran and
blocking the release merge queue.
Cache the NDK keyed on its version and, on a cache miss, install it up
front with a 3-attempt retry that purges the partial download between
tries. Gradle then finds it already present and never does the unguarded
in-build download.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The release merge queue (PR #149) failed on Instrumented Tests (30) — but no test actually ran. The job died in the Build test APKs step:
The same commit passed an earlier merge-queue run, confirming it's an infrastructure flake, not a code/test failure. We've hit this before.
Root cause
The
instrumented-testsjob removes all pre-installed NDKs (rm -rf $ANDROID_HOME/ndk) to save disk. Gradle then auto-downloads the required NDK (27.1.12297006, from React Native'slibs.versions.tomlvia Expo's default) on-the-fly during the build — a single-shotsdkmanagerdownload with no retry. When that fetch lands a corrupt zip, the whole job fails.Fix
Gradle then finds the NDK already present and never does the unguarded in-build download. Only the instrumented-tests job is affected; the JVM unit-tests job doesn't build native code.
Validated with
actionlint(clean).