EAS Build Android Error spawn ./gradlew EACCES

Error when try generate build in EAS “Build failed: spawn ./gradlew EACCES”

Thu, 31 Dec 2020 19:30:23 GMT

Starting build

2Thu, 31 Dec 2020 19:30:23 GMT

Download project archive

3Thu, 31 Dec 2020 19:30:23 GMT

Unpacking project archive

4Thu, 31 Dec 2020 19:30:23 GMT

Running yarn

5Thu, 31 Dec 2020 19:30:23 GMT

yarn install v1.22.10

6Thu, 31 Dec 2020 19:30:23 GMT

[1/4] Resolving packages...

7Thu, 31 Dec 2020 19:30:24 GMT

[2/4] Fetching packages...

8Thu, 31 Dec 2020 19:30:37 GMT

info fsevents@1.2.13: The platform "linux" is incompatible with this module.

9Thu, 31 Dec 2020 19:30:37 GMT

info "fsevents@1.2.13" is an optional dependency and failed compatibility check. Excluding it from installation.

10Thu, 31 Dec 2020 19:30:37 GMT

info fsevents@2.2.1: The platform "linux" is incompatible with this module.

11Thu, 31 Dec 2020 19:30:37 GMT

info "fsevents@2.2.1" is an optional dependency and failed compatibility check. Excluding it from installation.

12Thu, 31 Dec 2020 19:30:37 GMT

[3/4] Linking dependencies...

13Thu, 31 Dec 2020 19:30:37 GMT[stderr]

warning "@react-native-community/eslint-config > @typescript-eslint/eslint-plugin > tsutils@3.17.1" has unmet peer dependency "typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta".

14Thu, 31 Dec 2020 19:30:44 GMT

[4/4] Building fresh packages...

15Thu, 31 Dec 2020 19:30:44 GMT

Done in 21.15s.

16Thu, 31 Dec 2020 19:30:44 GMT

Writing secrets to the project's directory

17Thu, 31 Dec 2020 19:30:44 GMT

Starting gradle build

18Thu, 31 Dec 2020 19:30:44 GMT

Build failed: spawn ./gradlew EACCES

This looks to me like a problem on one of the Expo build servers. Have you tried more than once? There’s a chance that it will work on another server, but I think someone from the Expo team will have to have a look.

It might help them to track this down if you can paste the build ID/url here.

Build ID: d61b2573-fa53-4fdf-b57d-cccc01e7d4c1

I tried several times on different projects, I created one from scratch with create-react-native-app and it still doesn’t work.

can you run expo diagnostics on your machine and share the output here?

this may actually be an issue with your system git config. i expect that you are using windows? do you have a global .gitattributes file? what about .gitconfig? can you share those?

also, i expect that you won’t be able to run react-native run-android locally on your machine. can you try it and verify?

Yes I can run react-native run-android works fine in my local, I am not using expo in the project…

I am using windows, I haven’t default config files…

please share expo diagnostics as requested above.

i have never personally tried this from windows but did not expect there would be issues. do you ever have problems when pushing your code to ci that runs on linux machines? this could be caused by line endings. read more in Configuring Git to handle line endings - GitHub Docs

(that said - we should try to detect and handle these issues automatically, so i appreciate you posting about this!)

Ah! Unexpected, but yes, if it’s trying to run ./gradlew\r then that could indeed explain it.

Although I’d expect a file not found error rather that EACCESS.

Here the expo diagnostics

Expo CLI 4.0.17 environment info:
System:
OS: Windows 10 10.0.18363
Binaries:
Node: 12.18.0 - C:\Program Files\nodejs\node.EXE
Yarn: 1.10.1 - C:\Users\LAPTOP-MMC\AppData\Roaming\npm\yarn.CMD
npm: 6.14.5 - C:\Program Files\nodejs\npm.CMD
SDKs:
Android SDK:
API Levels: 17, 19, 23, 25, 26, 27, 28, 29
Build Tools: 23.0.1, 25.0.3, 26.0.0, 26.0.1, 27.0.0, 27.0.3, 28.0.2, 28.0.3, 29.0.2
System Images: android-27 | Google APIs Intel x86 Atom
IDEs:
Android Studio: Version 3.1.0.0 AI-173.4907809
npmPackages:
react: 16.13.1 => 16.13.1
react-native: 0.63.4 => 0.63.4
Expo Workflow: bare

could you possibly share a repository on github with an app that you have tried to build and that failed with this error?

account name: brentvatne

Yes, here the repository is a new project created using
react-native init projectName

I am using this command to do the build
eas build --platform android

BUILD ID: 160a2006-87c5-4e41-bd87-519dc042a59e

i cloned that repo and can reproduce it. it seems like somehow on your machine the executable bit does not get tracked.

permissions in your repo:

-rw-r--r--   1 brentvatne  staff   5.6K  2 Jan 12:31 gradlew

permissions in a new repo:

-rwxr-xr-x   1 brentvatne  staff   5.6K  2 Jan 13:33 gradlew

after pushing that repo to github and cloning it again, the same permissions apply:

-rwxr-xr-x   1 brentvatne  staff   5.6K  2 Jan 13:39 gradlew

apparently the cause of this is that windows filesystems fat32/ntfs only support partition-wide permissions, rather than permissions on a per-file basis.

you can fix your local copy of the repo by running this: git update-index --chmod=+x android/gradlew - after running that and committing the change, you should be able to build successfully.

we will update eas-cli to account for this windows quirk automatically in the future.

edit: i ran the build and it failed this time because the png images in android/app/src/main/res/mipmap-* are invalid. i also cannot open them locally on my machine. this particular issue does indeed seem related to line endings. similar issue here git add - Git converting CRLF to LF in images - Stack Overflow

1 Like

perfect, worked.

thank’s