React Native & Expo errors · Error 04 of 12

EAS Build failed: “Gradle build failed with unknown error”

By Muhammad Abdullah, full-stack, mobile and ai automation developer · Last reviewed

Gradle build failed with unknown error. See logs for the “Run gradlew” phase

Short answer

The real error is earlier in the build log. Open the “Run gradlew” phase, search for the first “FAILURE” or “error:” line, and fix that cause — most often mismatched package versions, a library that is incompatible with your SDK, or a broken config plugin.

Common causes

  • Expo and React Native packages that don’t match the installed SDK.
  • An outdated native library that doesn’t support the current React Native / New Architecture.
  • A config plugin or manual native change that fails during prebuild.
  • Cached native files from an earlier configuration.

How to fix it

  1. Check the project and align versions:

                          npx expo-doctor
    npx expo install --check
                        
  2. Reproduce locally to get a readable error:

                          npx expo prebuild --clean
    npx expo run:android
                        
  3. Update or replace the library named in the first error, then rebuild without cache:

                          eas build --platform android --clear-cache
                        

Let’s talk about the next step

Have an idea, a stuck app, or a workflow toimprove?

Tell me what you are building, what is blocking you, and what a successful outcome looks like.