EAS Build GradleWrapperMain missing

Hello,

I’im trying to go from manuel deployement to EAS build and submit but I have some trouble :
Expo build fail each time on the “run gradlew” step with this as error :

Running './gradlew :app:assembleRelease' in /home/expo/workingdir/build/app/android

[stderr] Error: Could not find or load main class org.gradle.wrapper.GradleWrapperMain

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

It’s wierd because the task ./gradlew :app:assembleRelease runs very well locally without error.

I understand that the gradle wraper is missing but I tried everything :

  • fixing it with the cmd “gradle wrapper”
  • Changing the gradle version from the last to 6.8.1
  • Deleted nodes_modules and re-install then re-build the project
  • Removed gradle files from .gitignore
  • searching google for answers …

I’m using a bare workflow with :

  • eas-cli/0.50.0 win32-x64 node-v16.13.1
  • react native 0.64.3
  • expo v44.0.6.

Any idea what is causing this ?

Thanks in advance,
Tim

you probably have stuff from android/gradle/wrapper gitignored, those files should be in repo

1 Like

If would love that but sadly it’s not :frowning:

image

What’s the mecanism used by eas build to upload the code ?

For me nothing is gitignored, and the wrapper is there so could you give me more informations plz ? The error displayed doesn’t help me and the build runs well locally.

This step should be easy …

try running eas build:inspect --stage=archive and check if directory created by this command has all those files there

What’s the mecanism used by eas build to upload the code ?

If you have cli.requireCommit: true in eas.json it’s making shallow clone using git

By default, we are making copy by parsing .gitignore files in js and filtering specific files, there are few cases that behave differently than git (fyi/eas-vcs-workflow.md at main · expo/fyi · GitHub)

Can you show the content of your gitignore files and their locations?

Allright thanks for your answer, I just tried “build:inspect --stage=archive”, and the command just copied my whole monorepo !!

I thought the command would work with the current dir, but well, after reading the expo-cli docs, I used the EAS_NO_VCS=1 environement variables to use the “NO VCS WORKFLOW” and exported that environement variables in my app.config.js but again the build:inspect cmd copied my whole monorepo …

This eas thing is a nightmare seriously nothing works as is and the docs lacks clarity and examples.

this is expected behavior, we are uploading entire git repo, otherwise, your project will likely break e.g. if you only upload one workspace there won’t be any lockfile

exported that environement variables in my app.config.js

it needs to be set in your shell, adding that app.config.js will not do anything

docs lacks clarity and examples.

EAS_NO_VCS exists for legacy reasons and it’s not recommended

But what about monorepo ?
The build command upload my RN app + my backend + my admin panel because it’s a monorepo.

Okay I will try again with the evironement variables in my shell thanks.

I assume you are not putting any secrets in the repo, and it’s unlikely that backend code is increasing the size of the upload significantly, so I don’t see any harm with uploading everything.

In general I don’t recommend keeping them in the same repo, but if you really want to do this with EAS_NO_VCS I recommend not using workspaces at all and just keep those things in separate directories, so each service has a separate lockfile

Hum why would I want to upload all of my monorepo just to build my app ?

I don’t have secrets in the code but it’s just wierd to not have an easy way of uploading the current directory. I think I’m gonna pass on EAS until some improvements are made on this side. The docs needs more example and clarity too (eveything you told me in this thread should be easily accessible in the docs).

Thanks for your time.

everything you told me in this thread should be easily accessible in the docs

Android build process - Expo Documentation + link I already send you in previous comment

I don’t see where else we could add that information, also the fact that the entire repo is used is very consistent with every CI service I’m aware of.

I think I’m gonna pass on EAS until some improvements are made on this side.

This sth we already discussed internally and we are not planning to support that. It’s possible with EAS_NO_VCS but we are still trying to discourage it.

Keeping backend and mobile app in one repo is a bit questionable, we are still considering that a valid workflow, but if you are uploading part of the monorepo it’s both risky in terms of security and it might introduce some new cases that we would need to implement support for.

1 Like

something you could consider @timrobdev is using git submodules if you want a monorepo but want to also be able to treat packages within the repo independently. as @wkozyra pointed out, you will find that every ci/cd service works the same as this (to my knowledge as well). for example, with vercel when you want to deploy a web app from a monorepo you link it to a github repo and point it to the subdirectory within the repo where your app lives. further, usually your app needs to be configured to work in a monorepo in such a way that it wouldn’t work on its own. for example, mayber you depend on some code elsewhere in the monorepo.