Error: spawnSync ./gradlew EACCES React Native Error Fix

I was trying to run one of my react native projects on the Android emulator and faced the following error.

Error: spawnSync ./gradlew EACCES

Error: spawnSync ./gradlew EACCES
at Object.spawnSync (internal/child_process.js:1041:20)
at spawnSync (child_process.js:607:24)
at execFileSync (child_process.js:634:15)
at runOnAllDevices (/home/rashid/Desktop/React Native/Tomorrow/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:74:39)
at buildAndRun (/home/rashid/Desktop/React Native/Tomorrow/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/index.js:158:41)
at /home/rashid/Desktop/React Native/Tomorrow/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/index.js:125:12
at processTicksAndRejections (internal/process/task_queues.js:85:5)
at async Command.handleAction (/home/rashid/Desktop/React Native/Tomorrow/node_modules/react-native/node_modules/@react-native-community/cli/build/cliEntry.js:160:7)

My PC runs on Ubuntu OS and here, I certainly felt it’s an error because of permission problems. A quick search on this React Native issue had brought me here and I got the solution too. I just run the following command in the terminal to make the gradlew folder executable.

chmod 755 android/gradlew

That’s it. My app again started to build successfully.

Similar Posts

4 Comments

Leave a Reply