CI: pre-install NDK+CMake with retry (SDK mirror served a corrupt CMake zip)
All checks were successful
build-apk / build (push) Successful in 10m37s

v0.1.7 build failed on ':react-native-screens:configureCMake' —
ZipException "Archive is not a ZIP archive" from a truncated cmake;3.22.1
download. Install ndk+cmake up front and retry up to 3x, clearing the partial
dir between attempts so a bad download self-heals.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Hank 2026-07-13 18:42:56 -07:00
parent 4cb5478737
commit 26b6a3ea82

View file

@ -53,11 +53,21 @@ jobs:
- name: Run client tests
run: npm test --workspace parksmarter-client
# RN 0.79 wants a specific NDK; install it if the image doesn't ship it (best-effort).
- name: Ensure NDK
# Pre-install the NDK + CMake the RN native modules need. Do it here (not via
# Gradle's mid-build auto-install) and retry: the SDK mirror sometimes serves
# a truncated archive ("Archive is not a ZIP archive"), which self-heals on a
# clean retry. Clearing the partial dir between tries avoids reusing the bad file.
- name: Ensure NDK + CMake
run: |
yes | sdkmanager --licenses >/dev/null 2>&1 || true
sdkmanager "ndk;27.1.12297006" >/dev/null 2>&1 || true
ok=0
for i in 1 2 3; do
if sdkmanager "ndk;27.1.12297006" "cmake;3.22.1"; then ok=1; break; fi
echo "sdkmanager attempt $i failed; clearing partial CMake and retrying"
rm -rf "${ANDROID_HOME:-/opt/android}/cmake/3.22.1" "${ANDROID_SDK_ROOT:-/opt/android}/cmake/3.22.1" 2>/dev/null || true
sleep 5
done
[ "$ok" = 1 ] || echo "WARNING: NDK/CMake pre-install did not confirm; the build may retry it."
- name: Restore signing keystore
run: echo "${{ secrets.ANDROID_KEYSTORE_B64 }}" | base64 -d > "${{ github.workspace }}/app/release.keystore"