Loading...
Loading...
Build an Expo React Native Android APK on GitHub Actions without EAS. Use when the user wants to build an APK/AAB from CI, set up a GitHub Actions workflow for expo prebuild + gradle assembleRelease, fix Android build failures in CI (Kotlin metadata mismatch, play-services-ads version conflicts, RNGMA/patch-package), download the APK artifact, or asks why the Android build fails with "incompatible version of Kotlin". Covers APK (release-signed via keystore, or debug-signed for quick tests) vs AAB (Play Store) choices and native dependency pinning. For signing/verify specifics (Play Console debug-mode rejections, apksigner vs jarsigner) see the android-release-signing skill.
npx skill4agent add hoangsoft90/ai_skills gh-actions-expo-apk-build| Situation | Use |
|---|---|
| Test APK on a real device, free, no token, auto on every push | This skill (GH Actions) |
EAS free tier stuck | This skill (GH Actions) |
| Upload to Play Store (AAB, proper signing, Play App Signing) | EAS Build |
| Need iOS build | EAS Build (GH Actions has no macOS here) |
android-release-signingexpo prebuild./gradlew bundleReleasereferences/aab-play-store-signing.mdandroid-release-signingreferences/troubleshooting.mdgoogle-services.jsonandroid/expo prebuildmainmastergit branch -M mainreferences/workflow-template.md.github/workflows/build-apk.ymlnpm ciexpo prebuild --clean --no-installCI: 1./gradlew assembleReleaseupload-artifact--cleanandroid/app.jsonif-no-files-found: errorgit add -A && git commit -m 'ci: add APK build workflow' && git push origin main
gh run list --repo <owner>/<repo> --limit 3
gh run watch <run-id> --repo <owner>/<repo> # or poll via gh run view --json status,conclusion
gh run view <run-id> --repo <owner>/<repo> --log-failed # when it fails — read THIS, not the full log--log-failed--log | grep <keyword>gh run download <run-id> --repo <owner>/<repo> --dir apk --pattern '*.zip'
# or, faster for large artifacts:
gh api repos/<owner>/<repo>/actions/artifacts --jq '.artifacts[] | select(.workflow_run.id==<run-id>) | {name, id, size_in_bytes, archive_download_url}'
curl -sL -H "Authorization: Bearer $GH_TOKEN" -o apk/artifact.zip '<archive_download_url>'
unzip -o -q apk/artifact.zip -d apk && ls -lh apk/*.apkGH_TOKENreferences/troubleshooting.mdreferences/aab-play-store-signing.mdANDROID_KEYSTORE_BASE64/PASSWORD/ALIAS/KEY_PASSWORDexpo prebuildbundleReleaseandroid-release-signingnpx eas-cli build --platform android --profile productionEXPO_TOKENeas.jsonproductionbuildType: "app-bundle"autoIncrement: truenpx eas-cli build --platform android --profile productionnpx eas-cli credentials --platform androidcredentials.jsonnpx eas-cli submit --platform android| Open when... | File |
|---|---|
| Writing or adjusting the workflow YAML (steps, JDK/Node versions, caching, debug/release variants, secrets) | |
Building for the Play Store: AAB, keystore, Play App Signing, | |
Build fails at | |
| Need to pin a transitive Gradle dependency via config plugin | |
| Update/maintain this skill's contract | |
git remote -vgit -c http.extraheader="AUTHORIZATION: basic $(printf 'x-access-token:%s' "$GH_TOKEN" | base64)" push origin maineas credentialscredentials.jsoneas submitkotlinVersionexpo-build-propertieskotlinVersionandroid/gradle/libs.versions.tomlandroid/android/build.gradle