All answers

Publishing

Why did my EAS build fail with a gradlew or expo export:embed error?

A missing gradlew means your project has an android folder, so it was built as a project whose native code you manage yourself, but that folder is incomplete. The export:embed error means your JavaScript failed to bundle, and the real error is a few lines above it in the build log.

Updated October 31, 2026

A failed build is frustrating, because the error at the bottom of the log isn’t always the one that matters, and every retry means another wait in the build queue. Each of these two messages has a clear cause, though.

”ENOENT: no such file or directory, open ’…/android/gradlew’”

Why it happens. A project with an android folder is built as one where you manage the native Android code yourself, so the build uses that folder exactly as it is instead of generating a fresh one. That’s fine when the folder is complete, but if it’s only partly in your repository, for example because gradlew is listed in .gitignore or .easignore, the build can’t find the script it needs to start Gradle.

How to fix it. The fix depends on whether you edit the native Android code yourself:

  1. If you don’t edit native Android code by hand, delete the android folder, and the ios folder if you have one, and add both to .gitignore. Fresh native projects are then generated from your app.json and config plugins on every build, which Expo calls Continuous Native Generation.

  2. If you do maintain native code, commit the full android folder, including android/gradlew and android/gradle/wrapper/, and make sure gradlew is executable:

    git update-index --chmod=+x android/gradlew

“npx expo export:embed —eager —platform android —dev false exited with non-zero code: 1”

Why it happens. This is the step that bundles your JavaScript into the app, and the line itself only tells you that the step failed. The cause is printed just above it.

How to fix it.

  1. Open the build in the Expo dashboard, expand Run gradlew, and scroll up from the failure to the first error. It might be a missing module or a syntax error, with the file name next to it.

  2. Reproduce it on your computer. We’d do this before starting another cloud build, because it’s faster:

    npx expo export --platform android
  3. Fix what it reports. Causes worth checking for include:

    • an import with the wrong capitalization, which works on macOS but fails on the Linux build servers
    • a package that’s used but missing from package.json
    • an environment variable that exists on your computer but not in EAS
  4. Check your dependencies with npx expo install --check and npx expo-doctor, which catch version mismatches between Expo and your packages.

How you know it’s fixed

npx expo export --platform android finishes on your computer, and the next EAS build gets past Run gradlew and produces an Android build.

If it still fails

Build logs are long, so search the Run gradlew section for the first error rather than the last. If the first error is about a native library, check that its version matches the one npx expo install would install for your SDK.

Ask the agent

If your app is in Draftbit, paste this into the agent, and it can read your code and make the change for you.

My Android build failed. Read the build log, find the first real error above the failing step, and fix it. If the android folder is incomplete and we don't edit native code by hand, remove it so it's generated during the build. Then run the JavaScript bundle locally to confirm it builds.

Open Draftbit

More Publishing answers