From 26b6a3ea82d235cadf3dfbe4e0444429f4d2f80c Mon Sep 17 00:00:00 2001 From: Hank Date: Mon, 13 Jul 2026 18:42:56 -0700 Subject: [PATCH] CI: pre-install NDK+CMake with retry (SDK mirror served a corrupt CMake zip) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- .forgejo/workflows/build-apk.yml | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/.forgejo/workflows/build-apk.yml b/.forgejo/workflows/build-apk.yml index 5a37e39..db592dd 100644 --- a/.forgejo/workflows/build-apk.yml +++ b/.forgejo/workflows/build-apk.yml @@ -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"