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

EAS Build fails when code is in a subdirectory

Open marcfrankel opened this issue 4 years ago • 9 comments

Build/Submit details page URL

https://expo.dev/accounts/saidthat/projects/saidthat/builds/e4ac4b21-bdf5-491c-988e-57d7c89548d2

Summary

EAS Android build fails when the main expo app folder is in a subdirectory of the overall project.

Basically, we have a folder structure set up like

Appname/ backendcode/ expoApp/ app.json eas.json ....etc

Managed or bare?

Managed (Dev Client)

Environment

EAS CLI 0.47.0 environment info: System: OS: macOS 12.2 Shell: 5.8 - /bin/zsh Binaries: Node: 16.13.2 - /usr/local/bin/node Yarn: 1.22.17 - /usr/local/bin/yarn npm: 8.1.2 - /usr/local/bin/npm Utilities: Git: 2.30.1 - /usr/bin/git npmPackages: expo: ~44.0.0 => 44.0.6 expo-dev-client: ~0.8.3 => 0.8.3 react: 17.0.1 => 17.0.1 react-dom: 17.0.1 => 17.0.1 react-native: 0.64.3 => 0.64.3 react-native-web: 0.17.1 => 0.17.1 npmGlobalPackages: eas-cli: 0.47.0 expo-cli: 5.1.1 Project workflow: generic

Error output

Fails in the Fix Gradlew step:

ENOENT: no such file or directory, open '/home/expo/workingdir/build/[name of our app directory]/android/gradlew'

Reproducible demo or steps to reproduce from a blank project

Setup a project like we laid out in the summary above and whatever the folder name you make the app code inside of will be in the error message.

marcfrankel avatar Feb 11 '22 19:02 marcfrankel

if the app is in a subdirectory of the repository then both app.json and eas.json should also be in the subdirectory

Managed (Dev Client)

Based on diagnostic output you have a bare project, not managed. you probably ran expo prebuild or expo run:android/ios

wkozyra95 avatar Feb 14 '22 09:02 wkozyra95

I hit the same issue - it was resolved by deleting the android/ directory. Not sure why it worked though...

calderwoodra avatar Aug 25 '22 07:08 calderwoodra

I have this same error for the last 9 hours, please how did you or do you fix this?

kelechionyeama avatar Oct 14 '22 04:10 kelechionyeama

@kelechionyeama Open an issue, describe the problem, what commands are you running, what is your directory structure and link to the build page.

wkozyra95 avatar Oct 14 '22 08:10 wkozyra95

I have managed workflows i am also facing the same issue

rizwan-incapsulate avatar May 22 '23 11:05 rizwan-incapsulate

i have 2 sub directory for my front end and server in my repository, when i try to eas build, it said an error that the package.json is missing when its actually there, its not on my gitignore either, i reckon that the directory that is "being built" is the root directory which has no package.json, so do i need to build another directory? its frustrating

juankarlo26 avatar Jun 10 '23 11:06 juankarlo26

I think I solved by making sure my files where in order.

kelechionyeama avatar Jun 10 '23 12:06 kelechionyeama

pls pls elaborate on what order??

my repository is as followed:

RepoV4 >Client-repo >app.json >package.json > Server -repo

im trying to eas build on the Client-repo subdirectory because that is where my package.json were, but i always encounter error saying package.json is missing when i eas build, which is why i think that the one being build was my whole "RepoV4" repository :( what do i need to do?

I think I solved by making sure my files where in order.

juankarlo26 avatar Jun 10 '23 12:06 juankarlo26

pls pls elaborate on what order??

my repository is as followed:

RepoV4 >Client-repo >app.json >package.json > Server -repo

im trying to eas build on the Client-repo subdirectory because that is where my package.json were, but i always encounter error saying package.json is missing when i eas build, which is why i think that the one being build was my whole "RepoV4" repository :( what do i need to do?

I think I solved by making sure my files where in order.

Just make sure everything is at the root of your project. eas files, app.json, package.json

kelechionyeama avatar Jun 10 '23 15:06 kelechionyeama