eas-cli icon indicating copy to clipboard operation
eas-cli copied to clipboard

EAS build fails with gradlew Spawn ENONENT

Open zegenerative opened this issue 9 months ago • 20 comments

Build/Submit details page URL

https://expo.dev/accounts/zegerdevos/projects/sugenda-front-end/builds/100f4b9f-6347-4362-a7d6-1b5411798538

Summary

When I run
eas build --platform android --profile development
it fails when I locally have already an android folder in my repo. when I delete this and run it again, the build will succeed.

BTW - your link to workflows (managed/bare) in this form has a 404

Managed or bare?

Managed

Environment

expo-env-info 1.2.2 environment info:
    System:
      OS: macOS 14.7.4
      Shell: 5.9 - /bin/zsh
    Binaries:
      Node: 21.6.2 - ~/.nvm/versions/node/v21.6.2/bin/node
      Yarn: 1.22.22 - /opt/homebrew/bin/yarn
      npm: 10.2.4 - ~/.nvm/versions/node/v21.6.2/bin/npm
      Watchman: 2025.03.10.00 - /usr/local/bin/watchman
    Managers:
      CocoaPods: 1.15.2 - /usr/local/bin/pod
    SDKs:
      iOS SDK:
        Platforms: DriverKit 24.0, iOS 18.0, macOS 15.0, tvOS 18.0, visionOS 2.0, watchOS 11.0
    IDEs:
      Android Studio: 2024.1 AI-241.18034.62.2412.12266719
      Xcode: 16.0/16A242d - /usr/bin/xcodebuild
    npmPackages:
      expo: ~52.0.39 => 52.0.39
      expo-router: ~4.0.19 => 4.0.19
      react: 18.3.1 => 18.3.1
      react-dom: 18.3.1 => 18.3.1
      react-native: 0.76.7 => 0.76.7
      react-native-web: ~0.19.13 => 0.19.13
    npmGlobalPackages:
      eas-cli: 15.0.15
      expo-cli: 6.3.10
    Expo Workflow: managed

Error output

See link to build.

Build failed

ENOENT: no such file or directory, open '/home/expo/workingdir/build/android/gradlew'

Reproducible demo or steps to reproduce from a blank project

see description

zegenerative avatar Mar 22 '25 07:03 zegenerative

I've been getting similar message, I tried many things but nothing helped with a fix. A week ago building a project worked without any issues. No changes in project setup.

Mon, 24 Mar 2025 23:20:04 GMT ENOENT: no such file or directory, open '/home/expo/workingdir/build/android/gradlew'

AVATAR197 avatar Mar 24 '25 22:03 AVATAR197

Root of the issue is that I was trying to import file that did not exist inside app.confg.ts file. Make sure all files that you import there are correct. It would also be appreciated if expo can show us better error in this case.

AVATAR197 avatar Mar 25 '25 00:03 AVATAR197

Same error here

Image

Juanperezc avatar Apr 10 '25 23:04 Juanperezc

Same issue Image

anhltsefpt avatar Apr 15 '25 01:04 anhltsefpt

Hi, did anyone figure out the issue? I tried @AVATAR197 suggestion but there are no files in my app.json/app.config.ts file that doesn't exist. @zegenerative Please let us know if you have figure out a solution.

virajdoshi11 avatar Apr 15 '25 21:04 virajdoshi11

I found same issue like this.

Image

In my solution check on .gitignore and find this

/android
/ios

remove this line and re-build with eas build --profile development --platform android --local then work.

frogconn avatar Apr 22 '25 04:04 frogconn

Why are you guys posting screenshots of the errors? It makes it difficult for others to find this issue when searching google or github.

[FIX_GRADLEW] 
Error: ENOENT: no such file or directory, open '/var/folders/w0/dpsjc0t96lg1x8l_qzp2gdqh0000gn/T/eas-build-local-nodejs/769eeaa2-0a78-4a3f-8827-378442e4375c/build/android/gradlew'

Build failed
Unknown error. See logs of the Fix gradlew build phase for more information.

gradlew builds succeed

./gradlew assembleRelease

Possibly realted to https://github.com/expo/eas-cli/issues/2866

This might be helpful for anyone looking into this issue reproduce the problem. This issue happens on this repo for me.

jaaywags avatar Apr 24 '25 00:04 jaaywags

Okay I solved this for my case. @AVATAR197 pointed me in the right direction. I did not have any files in app.json that did not exist. But my specific case I migrated from a RN CLI project to expo. I had tried to delete any packages, files and folders I did not need. I think I missed one though. I deleted a .bundle folder and now my builds pass.

jaaywags avatar Apr 24 '25 04:04 jaaywags

Thanks @frogconn removing ./android ./ios from gitignore fixed the issue

NinjaAniket avatar May 07 '25 14:05 NinjaAniket

But Still

npx expo-doctor@latest
env: load .env env: export EXPO_PUBLIC_API_BASE EXPO_PUBLIC_ANDROID_API_BASE EXPO_PUBLIC_SERVER_SCHEME EXPO_PUBLIC_ENV EXPO_PUBLIC_GOOGLE_CLIENT_ID 14/15 checks passed. 1 checks failed. Possible issues detected: Use the --verbose flag to see more details about passed checks.

✖ Check for app config fields that may not be synced in a non-CNG project This project contains native project folders but also has native configuration properties in app.json, indicating it is configured to use Prebuild. When the android/ios folders are present, EAS Build will not sync the following properties: scheme, orientation, icon, userInterfaceStyle, splash, notification, ios, android, plugins.

Advice: Add '/android' and '/ios' to your .gitignore file if you intend to use CNG / Prebuild. Learn more: https://docs.expo.dev/workflow/prebuild/#usage-with-eas-build

1 check failed, indicating possible issues with the project.

Gokulkrishna-Raju avatar May 10 '25 13:05 Gokulkrishna-Raju

Image

Tried by running expo-doctor

Image

Still facing the same issue

SamarthSJ avatar May 18 '25 12:05 SamarthSJ

Facing the same issue on a very old repo, creating a new codebase does not have the problem

nicolasguzca avatar May 20 '25 20:05 nicolasguzca

Thanks @frogconn removing ./android ./ios from gitignore is fixed the issue for me

duykhanh0409 avatar May 23 '25 01:05 duykhanh0409

I found same issue like this.

Image

In my solution check on .gitignore and find this

/android
/ios

remove this line and re-build with eas build --profile development --platform android --local then work.

thanks, this is very helpful

alwi2022 avatar May 25 '25 06:05 alwi2022

For me it helped to remove local /android folder and to run again.

This is definitely a change since eas-cli 15.x

RockyMM avatar May 27 '25 09:05 RockyMM

Thanks you all. By removing /android and /ios we got something else came up with expo-doctor check failed

✖ Check for app config fields that may not be synced in a non-CNG project This project contains native project folders but also has native configuration properties in app.json, indicating it is configured to use Prebuild. When the android/ios folders are present, EAS Build will not sync the following properties: orientation, icon, scheme, userInterfaceStyle, ios, android, plugins.

Advice: Add '/android' and '/ios' to your .gitignore file if you intend to use CNG / Prebuild. Learn more: https://docs.expo.dev/workflow/prebuild/#usage-with-eas-build

1 check failed, indicating possible issues with the project.

hbweb avatar Jun 22 '25 10:06 hbweb

I found same issue like this. Image In my solution check on .gitignore and find this

/android
/ios

remove this line and re-build with eas build --profile development --platform android --local then work.

thanks, this is very helpful

Strangely, removing android and ios folder from gitignore does fix this. Thank u.

daveteu avatar Jul 02 '25 15:07 daveteu

i add /ios and /android and ALSO .vscode

youssefsahri avatar Jul 20 '25 01:07 youssefsahri

Check if you have added android/ ios/ into .gitignore, if added remove these lines from .gitignore, make sure you have ran npx expo prebuild

anantkrsingh avatar Aug 11 '25 16:08 anantkrsingh

Thanks @frogconn removing ./android ./ios from gitignore fixed the issue

This worked for me!!

naro-code-lab avatar Sep 21 '25 00:09 naro-code-lab