Changing the rights to the gradlew file helped me.
I compared the rights in the working draft and the project with this error, and it turned out that the rights should be -rwxrwxr-x, but were -rw-rw-r--.
To fix this, just run the command chmod +x gradlew in the android directory.