将Travis CI用于现有Android项目调用
$ ./gradlew build connectedCheck
我得到了这个错误:
/home/travis/build.sh: line 45: ./gradlew: Permission denied
The command "./gradlew build connectedCheck" failed and exited with 126 during .
将Travis CI用于现有Android项目调用
$ ./gradlew build connectedCheck
我得到了这个错误:
/home/travis/build.sh: line 45: ./gradlew: Permission denied
The command "./gradlew build connectedCheck" failed and exited with 126 during .
这取决于unix gradlew
脚本的exec-permission.
It can be fixed using the command:
git update-index --chmod=+x gradlew
一点描述来理解这个问题
git ls-tree HEAD
您将看到:
100644 blob xxxxxxxxxxx gradlew
如您所见,该文件拥有644权限.
Fix it by setting the executable flag on your gradlew file changing it to 755:
git update-index --chmod=+x gradlew
只需提交并推动更改:
git commit -m "permission access for travis"
[master e80ab1b] gradlew permission access for travis
1 file changed, 0 insertions(+), 0 deletions(-)
mode change 100644 => 100755 gradlew
最后一次判断再次运行git ls-tree以查看更改:
git ls-tree HEAD
你可以看到:
100755 blob xxxxxxxxxxxxx gradlew
Another way to solve this issue is to use:
before_install:
- chmod +x gradlew
这种解决方案不会更改git repo中的权限,只会更改执行中的权限运行时.