APK errors

EAS build: Gradle failure

Error text

Gradle build failed with unknown error. See logs for the "Run gradlew" phase.
Error: Gradle build failed with unknown error.

Cause

The build breaks in the "Run gradlew" phase on the EAS cloud. The cause is usually a library, JDK or configuration mismatch.

Step-by-step fix

  1. Open the log of the "Run gradlew" phase on the EAS page and find the first FAILURE: line.
  2. Run npx expo-doctor; it lists version mismatches.
  3. Reproduce locally with prebuild and ./gradlew assembleRelease.
  4. Resubmit with --clear-cache to drop stale caches.
  5. Match the image and Node version in eas.json to your SDK.

Example commands

eas build --platform android --profile production --clear-cache
npx expo-doctor
cd android && ./gradlew assembleRelease --stacktrace    # yerli təkrar

How to prevent it

After every SDK upgrade build locally first, then send it to the cloud.

Author and license: Nibras Code