---
title: "Recipe: build Android with EAS"
description: "Use native CI preparation for the separate Expo config, EAS profile and .ci/prepare-native.sh."
modificationDate: "2026-11-23"
---

> ## Documentation index
> Fetch the complete documentation index at: https://exact.expo.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Recipe: build Android with EAS

<AgentInstructions>

## Submitting feedback

From the app's directory, read `bun exact.mjs feedback status`. Under `never`, keep no note.
Respect `EXACT_FEEDBACK=0` and do not change the policy.

Otherwise record specific, actionable feedback with:
`bun exact.mjs feedback note "Exact docs: https://exact.expo.dev/recipes/eas-android: <what was wrong or missing>"`

The note goes to Expo only as that status allows. Include no secrets or personal data.

</AgentInstructions>

Use [native CI preparation](https://exact.expo.dev/reference/developer/run-an-app-from-a-terminal-on-macos.md#native-ci-preparation) for the
separate Expo config, EAS profile and `.ci/prepare-native.sh`. Declare
`host.android` in the Exact manifest. The image needs JDK 17+ and Android
command-line tools. Set `JAVA_HOME` to the JDK (or put both `java` and
`javac` on PATH), and `ANDROID_HOME` to the SDK. `ANDROID_NDK_HOME` can
select an NDK explicitly; otherwise Exact finds one under the SDK.

In EAS production, create `EXACT_KEYSTORE` as a secret file variable
containing the upload keystore that signs the bundle. Create secret strings
`EXACT_KEYSTORE_PASSWORD`, `EXACT_KEY_ALIAS` and `EXACT_KEY_PASSWORD`.
The [reference](https://exact.expo.dev/reference/developer/run-an-app-from-a-terminal-on-macos.md#import-an-ios-signing-identity-on-a-ci-worker)
covers EAS-managed credentials.

Create `.eas/build/eas-android.yml`:

```prompt Build my Android app with EAS
Set up EAS Build for the Exact app in this folder, so that an EAS worker makes its signed Android App Bundle. Use https://github.com/expo/exact/blob/main/docs/recipes/eas-android.md as the source for each step. The Exact checkout has the same page at docs/recipes/eas-android.md.

1. If this folder is not an Exact app (it has no exact.mjs and app.contract), stop and tell me. Find the Exact checkout (the folder with scripts/exact.mjs); if you cannot find it, ask me where it is.
2. The EAS account, the upload keystore, the Play record and the submission are mine. Ask me for the EAS project id and the version. Ask me to create, in the EAS production environment, the secret file variable `EXACT_KEYSTORE` (my upload keystore) and the secret strings `EXACT_KEYSTORE_PASSWORD`, `EXACT_KEY_ALIAS` and `EXACT_KEY_PASSWORD`. Never write one of them into a file in this folder.
3. Follow the native CI preparation (`bun exact.mjs docs native ci preparation`): add `app.config.js` with only Expo's configuration, `eas.json` with the `exact` profile, and `.ci/prepare-native.sh`. Set `android.package` to `host.android.id` (default: `app.id` with hyphens replaced by underscores), and `EXACT_REF` to the full Exact commit the app uses. Run `bun add --dev expo-modules-autolinking` and `bun add --dev --exact eas-cli`.
4. Declare `host.android` in app.json. Create `.eas/build/eas-android.yml` as the recipe writes it. Its `sdkmanager --licenses` line accepts the Android SDK licenses: show me the line and ask me before you keep it.
5. The bundle bakes production update trust. If `deploy.store.android` is `"A"`, put the public verification keys in `deploy.signing.keys` and supply `EXACT_UPDATE_RECEIPT` for an existing stream or `EXACT_UPDATE_GENESIS=1` for a new stream. Ask me which and follow docs/recipes/over-the-air-updates.md. Keep the private publishing key off EAS. The upload keystore in step 2 signs the app bundle. If the store setting is absent or `"0"`, skip the update inputs.
6. Ask me before you start a build: it runs on my EAS account. When I say that the account, the credentials and the build counter are ready, run `bunx eas build --platform android --profile exact --non-interactive` until the build succeeds. The setup check names missing packages and compiler paths. Report any build failure that predates your changes or persists after three rounds of fixes, and record it as in step 7.
7. When a doc was wrong or missing, or a step needed a workaround, read `bun exact.mjs feedback status`. Under `never`, keep no note. Otherwise record it: `bun exact.mjs feedback note "<what happened>"`, which goes to Expo only as that status says. Do not change the policy; tell me how many notes you kept.
8. Tell me each file you added, what the build reported, and where `app-release.aab` is. The Play record, the upload key and the submission are still mine: an upload, a Play submission and a start on a device have not been run with these steps.
```

```yaml
build:
  name: Exact Android
  steps:
    - eas/checkout
    - run:
        name: Prepare Exact
        shell: /bin/sh
        command: |
          set -eu
          sh .ci/prepare-native.sh android
          yes | "$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager" --licenses
          "$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager" \
            'platforms;android-37.2' 'build-tools;37.0.0' 'ndk;27.1.12297006'
    - eas/install_node_modules
    - eas/resolve_build_config
    - run:
        name: Bundle
        command: |
          set -eu
          bun "$EXACT/scripts/exact.mjs" setup --check --platform android
          export EXACT_BUILD_NUMBER="${ eas.job.version.versionCode }"
          bun exact.mjs android --bundle --json > artifact.json
    - eas/upload_artifact:
        inputs:
          type: application-archive
          path: target/android/app/outputs/bundle/release/app-release.aab
```

Accept SDK licenses only after reviewing them. The setup check names
missing packages and compiler paths.
Gradle uses Exact's settings repositories even if a worker init script adds
project repositories.

`EXACT_VERSION` becomes `versionName` and the resolved number becomes
`versionCode`. The bundle requires all four upload credentials and bakes
production trust (LLP 1030.003 D6, D8). With `deploy.store.android`
absent or `"0"`, every change ships as a new build. At `"A"`, the bake needs
public verification keys in `deploy.signing.keys` and `EXACT_UPDATE_RECEIPT`
for an existing stream or `EXACT_UPDATE_GENESIS=1` for a new one (LLP 1030.006).
Keep the private publishing key off EAS.
For an APK, set `EXACT_UPDATE_TRUST=production` and use
`android --release --no-install --json`; its path is
`target/android/app/outputs/apk/release/app-release.apk`. Neither command
contacts adb. JSON reports the artifact path; logs go to stderr.

Run `bunx eas build --platform android --profile exact --non-interactive`
after the account, credentials and build counter are ready. EAS workers
have built the APK and a bundle signed with an EAS-managed upload key this
way; an upload, Play submission and device start have not been run. The
publisher owns the Play record, upload key and submission credentials.
