Skip to content

Harden Android CI Node/Gradle integration for react-native-reanimated evaluation - #4

Closed
King-Austin with Copilot wants to merge 3 commits into
mainfrom
copilot/fix-android-build-failure
Closed

King-Austin with Copilot wants to merge 3 commits into
mainfrom
copilot/fix-android-build-failure

Conversation

Copilot AI commented May 20, 2026 •

Copy link
Copy Markdown

The Android GitHub Actions job was failing while evaluating :react-native-reanimated because the Gradle build step’s node invocation exited non-zero. This PR updates the Android workflow so Node is explicitly available/compatible during Gradle evaluation and the workflow definition is valid and deterministic.

  • Workflow normalization + runtime pinning

    • Replaced malformed HTML-escaped workflow content with valid YAML.
    • Pinned workflow Node runtime to 20.19.0 for stable compatibility with RN/Gradle tooling in CI.
  • Make Node explicitly available to Gradle subprocesses

    • Added a step to export NODE_BINARY and NODE_BIN_DIR to GITHUB_ENV.
    • Passed these into Gradle build steps so react-native-reanimated’s node-based resolution can run reliably.
  • Android build-step robustness

    • Added chmod +x android/gradlew before Gradle execution.
    • Added --stacktrace to Gradle invocations for actionable CI diagnostics.
  • Workflow token hardening

    • Added explicit least-privilege workflow permissions:
      • permissions: contents: read
env:
  NODE_VERSION: '20.19.0'

- name: Expose Node runtime for Gradle subprocesses
  run: |
    echo "NODE_BINARY=$(command -v node)" >> "$GITHUB_ENV"
    echo "NODE_BIN_DIR=$(dirname \"$(command -v node)\")" >> "$GITHUB_ENV"

- name: Build Android APK (debug)
  env:
    PATH: ${{ env.NODE_BIN_DIR }}:${{ env.PATH }}
    NODE_BINARY: ${{ env.NODE_BINARY }}
  run: |
    cd android
    ./gradlew assembleDebug --stacktrace

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • dl.google.com
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED --add-opens=java.xml/javax.xml.namespace=ALL-UNNAMED -Xmx1536m -Dfile.encoding=UTF-8 -Duser.country -Duser.language=en -Duser.variant -cp /home/REDACTED/.gradle/wrapper/dists/gradle-8.14.3-all/10utluxaxniiv4wxiphsi49nj/gradle-8.14.3/lib/gradle-daemon-main-8.14.3.jar (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

Fix the Android build failure in GitHub Actions. The failing job is https://github.com/King-Austin/Smart_Classroom_Attendance/actions/runs/26154570175/job/76930444878. Error: Gradle fails evaluating :react-native-reanimated because running node in native/node_modules/react-native-reanimated/android/build.gradle (line 53) exits with code 1. Update the repo so the build runs successfully in CI. Make changes needed in workflow/config/dependencies to ensure Node is available and compatible during the Gradle build, and that react-native-reanimated’s build step succeeds. After fixing, open a PR with the changes.

The following is the prior conversation context from the user's chat exploration (may be truncated):

User: How can I fix this build?

Assistant: Your build failed at the react-native-reanimated native module. The main issue is this error:

Process 'command 'node'' finished with non-zero exit value 1

This means the Gradle build couldn't execute a node process successfully while evaluating react-native-reanimated's build.gradle (line 53).

How to fix:

  1. Make sure Node.js is installed and accessible in your build environment.

  2. Verify you are using compatible versions of:

    • Node.js
    • react-native
    • react-native-reanimated
  3. Try deleting node_modules and clearing Gradle cache:

    rm -rf node_modules android/build .gradle
    yarn install
    cd android && ./gradlew clean
    
  4. Double-check your react-native-reanimated installation steps in the official documentation: https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/installation/

If the error continues, check the file:

  • native/node_modules/react-native-reanimated/android/build.gradle at line 53
    for any custom code that might fail.

If you need help analyzing that part of the code, let me know!

User: pls do a fix to this:
i need the build to run successfully
then make a PR

Assistant: I’m waiting for your approval to proceed with the fix and PR—once you confirm, I’ll continue.

This pull request was created from Copilot chat.

@vercel

vercel Bot commented May 20, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
smart-attendance Ready Ready Preview, Comment May 20, 2026 10:46am

Copilot AI changed the title [WIP] Fix Android build failure in GitHub Actions Harden Android CI Node/Gradle integration for react-native-reanimated evaluation May 20, 2026
Copilot AI requested a review from King-Austin May 20, 2026 10:48
@King-Austin
King-Austin marked this pull request as ready for review May 21, 2026 21:11
Copilot AI review requested due to automatic review settings May 21, 2026 21:11

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR repairs and hardens the Android GitHub Actions workflow so Gradle can reliably execute Node during react-native-reanimated evaluation, and makes the workflow definition valid YAML.

Changes:

  • Replaced the previously HTML-escaped (invalid) workflow content with proper YAML.
  • Pinned the Node runtime to 20.19.0 and added a step to expose Node path details for downstream steps.
  • Added Gradle robustness tweaks (chmod +x on gradlew, --stacktrace) and least-privilege workflow permissions (contents: read).
Comments suppressed due to low confidence (1)

.github/workflows/build-android.yml:64

  • Same issue here: PATH: ${{ env.NODE_BIN_DIR }}:${{ env.PATH }} references env.PATH, which is unset in this workflow, so PATH can become effectively just NODE_BIN_DIR:. Use $GITHUB_PATH once (preferred) or prepend using the shell’s $PATH to avoid breaking the environment for Gradle.
        env:
          PATH: ${{ env.NODE_BIN_DIR }}:${{ env.PATH }}
          NODE_BINARY: ${{ env.NODE_BINARY }}

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +54 to +56
env:
PATH: ${{ env.NODE_BIN_DIR }}:${{ env.PATH }}
NODE_BINARY: ${{ env.NODE_BINARY }}
@King-Austin
King-Austin deleted the copilot/fix-android-build-failure branch August 15, 2026 22:25

This branch was successfully deployed

1 active deployment
Preview — 5657e182 Deployed May 20, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants