androidreact-nativereact-native-cli

I've tried all commands related to the issue I have, & have given Excutable access to gradlew, yet i still keep getting Error: spawn ./gradlew EACCES


Check error here

I've given permission to the project > android folder and android > gradlew file, yet i've keep getting

Error: spawn ./gradlew EACCES
    at ChildProcess._handle.onexit (node:internal/child_process:286:19)
    at onErrorNT (node:internal/child_process:484:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)

I've tried all commands like

sudo chmod -R 777 android/gradlew
sudo chmod +x gradlew

I've deleted my node_modules and re-installed it, i've also update node from 18 to 20

npx react-native doctor //shows everything is setup right

click to view terminal


Solution

  • the issue was that i touched/edited/viewed the gradlew file, The solution was to generate another gradlew file, and did this, sudo chmod -R 777 android/gradlew