Related Articles

Back to Latest Articles

Fixing React native gradlew access error

How to fix React native ./gradlew access error

Baraa Abuzaid
Fixing React native gradlew access error

If you are getting this error and you are pulling your hair off try to figure out what goes wrong! look no further here are few steps you can take to solve this issue.

error Failed to install the app. Make sure you have the Android development environment set up:
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)

./gradlew EACCES
Make sure your Environment variable are setup correctly. This environment variable allow react native CLI to access android SDK

use this if you are on visual studio code

code  ~/.bash_profile

or this if you know how to exist vim

vim ~/.bash_profile


touch ~/.bash_profile; open ~/.bash_profile

Then you can add the following lines and save. Now react native is able to access android SDK tools allowing it to run your app.

export ANDROID_HOME=$HOME/Library/Android/sdk
export PATH=$PATH:$ANDROID_HOME/emulator
export PATH=$PATH:$ANDROID_HOME/tools/bin
export PATH=$PATH:$ANDROID_HOME/platform-tools

Not yet done. after this you should add the right access permission for file ./gradlew
this could be done by opening your terminal and adding this

chmod 755 android/gradlew 

hopefully this helps you to resolve ./gradlew EACCES error.

Show Comments (0)


Related Articles


Coding Identity Matrix in Python

Basically, the identity matrix is a matrix of zero elements except for the main diagonal elements is set to one. a more formal definition could be written as A matrix I ∈...

Posted on by Baraa Abuzaid

Valid Sudoku

So this article is about validating a fun logic game called sudoku. Sudoku board is consists of 9×9 gird, which contains 3×3 subgrids.The objective is to fill a 9×9 grid...

Posted on by Baraa Abuzaid