Gradlew — “Permission denied”

Jimmy Albert
Oct 16, 2023

--

(note: if you are running on Windows then replace gradlew by gradlew.bat in my answer or you can modify both at the same time if other members of your team are on Windows)

If you run ./gradlew and get a “permission denied” from terminal then here are two solutions:

  • 1) Common solution is to modify the rights of file gradlew then making sure that your GIT also register it (don’t forget to commit!)
chmod +x gradlew
git update-index --chmod=+x gradlew
  • 2) If that does not work, the second, and rarely found, solution is to copy the file gradlew from a clean android project. (If your project is on react-native, I suggest to create a new react-native project that has the same version than your project then copy from it)

--

--