fix(rn_cli_wallet): pin Android NDK version to stop flaky E2E builds#564
fix(rn_cli_wallet): pin Android NDK version to stop flaky E2E builds#564ignaciosantise wants to merge 3 commits into
Conversation
The Android E2E job intermittently failed with a corrupted NDK download (ndk;27.1.12297006 -> "Archive is not a ZIP archive" -> InstallFailedException), passing on rerun. The action already pre-installed the NDK to avoid the on-the-fly fetch, but its hardcoded 27.0.12077973 had drifted from the 27.1.12297006 the Expo SDK 56 build now wants — so it seeded the wrong NDK and Gradle re-fetched the right one at build time (the flaky path). Make app.json the single source of truth via a new withAndroidNdkVersion config plugin: it injects ext.ndkVersion into the generated android/build.gradle (before expo-root-project applies, so Expo's setIfNotExist default is a no-op), and the E2E action reads the same app.json entry to pre-install that exact NDK (now with a retry so a corrupt archive self-heals). Documents the upgrade-time check in AGENTS.md. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Claude finished @ignaciosantise's task in 2m 35s —— View job Code Review
Found 1 issue(s)Issue 1: Kotlin DSL build.gradle silently skips NDK injectionID: withAndroidNdkVersion-kotlin-dsl-silent-skip-a3f1 Context:
Recommendation: Throw on unsupported language so the failure is immediate and loud: return withProjectBuildGradle(config, cfg => {
if (cfg.modResults.language !== 'groovy') {
throw new Error(
`withAndroidNdkVersion: expected groovy build.gradle, got '${cfg.modResults.language}'. ` +
'Update the plugin for Kotlin DSL support.'
);
}
cfg.modResults.contents = setNdkVersion(cfg.modResults.contents, ndkVersion);
return cfg;
}); |
Address PR review: the plugin silently no-op'd when the generated root build.gradle wasn't groovy. If a future Expo SDK emits a Kotlin DSL (build.gradle.kts) root project, that skip would leave the NDK unpinned and quietly reintroduce the corrupt-download flake this plugin exists to prevent. Throw loudly instead so the failure is immediate and obvious. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Pins the Android NDK version for wallets/rn_cli_wallet so the Expo/Gradle build and the CI pre-install both use the same version, preventing flaky CI failures caused by intermittent corrupted NDK downloads during on-the-fly installation.
Changes:
- Added an Expo config plugin to inject
ext.ndkVersioninto the generatedandroid/build.gradlebeforeexpo-root-projectapplies its default. - Pinned the NDK version in
wallets/rn_cli_wallet/app.jsonas the single source of truth. - Updated the walletkit E2E composite action to read that pinned version from
app.jsonand pre-install it viasdkmanager(with retries), plus documented upgrade guidance inAGENTS.md.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| wallets/rn_cli_wallet/plugins/withAndroidNdkVersion.js | New config plugin that injects ext.ndkVersion into the generated root build.gradle before Expo’s default is applied. |
| wallets/rn_cli_wallet/app.json | Adds the plugin entry and pins the NDK version (27.1.12297006). |
| wallets/rn_cli_wallet/AGENTS.md | Documents the NDK pinning approach and upgrade-time verification steps. |
| .github/actions/walletkit-build-and-maestro/action.yml | Reads the pinned NDK version from app.json and pre-installs via sdkmanager with retries. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Address PR review (Copilot): the retry loop disabled pipefail but left errexit on, so a non-zero `yes | sdkmanager` aborted the step before `status=$?` ran — attempts 2/3 never executed. Capture the result via an `if` (exempt from set -e) so failures are caught and retried as intended. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Problem
The Android E2E job intermittently failed during the Gradle build with a corrupted NDK download, passing only on rerun:
Root cause: the action already pre-installed the NDK (to avoid RN's flaky on-the-fly fetch), but its hardcoded
27.0.12077973had drifted from the27.1.12297006that Expo SDK 56 now wants. So it seeded the wrong NDK and Gradle re-fetched the right one at build time — the exact download that intermittently corrupts.Fix
Make
app.jsonthe single source of truth for the NDK version:plugins/withAndroidNdkVersion.js(new config plugin) injectsext.ndkVersioninto the generatedandroid/build.gradle, beforeapply plugin: "expo-root-project"— so Expo'ssetIfNotExist("ndkVersion")default becomes a no-op and our pin wins.app/build.gradlekeeps readingndkVersion rootProject.ext.ndkVersionunchanged.app.jsonholds the version as the plugin arg..github/actions/walletkit-build-and-maestroreads that sameapp.jsonentry to pre-install the exact NDK viasdkmanager, now wrapped in a 3× retry so a corrupt archive self-heals instead of failing the run.AGENTS.mddocuments the upgrade-time check (re-verify the pin on every RN/Expo bump).Now the native build and the CI pre-install both derive from one line in
app.json— no drift, nonode_modulesgrepping.Verification
expo prebuild --platform android --clean→android/build.gradlegetsext.ndkVersion = "27.1.12297006"immediately aboveapply plugin: "expo-root-project".27.1.12297006fromapp.json.🤖 Generated with Claude Code