Skip to content

ci: fix the apk job (setup-android action + Gradle 9 vs AGP 8.12) - #2

Open
SenZh wants to merge 1 commit into
azygoss:mainfrom
SenZh:ci/fix-android-build
Open

SenZh wants to merge 1 commit into
azygoss:mainfrom
SenZh:ci/fix-android-build

Conversation

@SenZh

@SenZh SenZh commented Oct 20, 2026

Copy link
Copy Markdown

What

The apk job has been failing before it reaches any project code. Two independent breakages:

1. android-actions/setup-android@v3 fails on the current hosted runner.
The job stops there, so npm ci and the build never run. ubuntu-latest already ships the Android SDK, so this installs the pinned packages with sdkmanager instead of going through the action:

"$SDK/cmdline-tools/latest/bin/sdkmanager" "platform-tools" "platforms;android-36" \
  "build-tools;36.0.0" "ndk;27.1.12297006" "cmake;3.22.1"

2. Gradle 9 + AGP 8.12 cannot configure the :expo project.
expo prebuild generates gradle-9.3.1-bin.zip in the wrapper, while react-native/gradle/libs.versions.toml pins agp = 8.12.0. That pair dies at configuration time with:

A problem occurred configuring project ':expo'.
> SoftwareComponent with name 'release' not found.

After prebuild the wrapper is pointed at Gradle 8.14.3, which is the line AGP 8.12 supports. Reproduced and verified locally: 9.3.1 fails in ~9 min at configuration, 8.14.3 builds the arm64 release APK.

Also

  • workflow_dispatch so a build can be triggered without pushing a tag (handy for testing the toolchain).
  • upload-artifact before the release step, so a build is retrievable even when the release upload or the signing secret is missing.
  • softprops/action-gh-release gets continue-on-error: true; without a release permission the artifact is still the deliverable.

Verification

Ran this exact workflow on a fork against v1.8.0 and it produced a working arm64 APK (apksigner verify clean, INTERNET permission present, assets/index.android.bundle intact). The check job is unaffected.

No project source is touched — the diff is .github/workflows/android.yml only.

Both apk-job failures on this repository happen before any project code runs:

- android-actions/setup-android@v3 fails on the current hosted runner, so the
  job never reaches npm ci (the SDK is already installed on ubuntu-latest).
- expo prebuild generates a Gradle 9 wrapper while React Native ships AGP
  8.12; that pairing fails at configuration time with
  "SoftwareComponent with name 'release' not found".

Install the pinned SDK packages with sdkmanager, pin the wrapper to Gradle
8.14.3 after prebuild, and upload the APK as an artifact as well as to the
release. workflow_dispatch is added so a build can be triggered without a tag.
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.

1 participant