Using Travis CI for an existing Android project calling
$ ./gradlew build connectedCheck
I get this error:
/home/travis/build.sh: line 45: ./gradlew: Permission denied
The command "./gradlew build connectedCheck" failed and exited with 126 during .
It depends by the exec-permission to your unix
gradlew
script.It can be fixed using the command:
A little desciption to understand the problem.
First of all you can check your permissions using:
You will see:
As you can see the file has 644 permission.
Fix it by setting the executable flag on your gradlew file changing it to 755:
Just commit and push the changes:
A last check running git ls-tree again to see the change:
You can see:
Another way to solve this issue is to use:
This kind of solution doesn't change the permission in your git repo, but just changes the permission runtime in the execution.
Thanks all. This code is available. The key focus is on
chmod +x