Ameer Ameer -4 years ago 189
Android Question

Travis CI - Android Project Build Failing

Reference build:

My .travis.yml is:

language: android
- tools
- build-tools-19.1.0
- android-19
- platform-tools

- chmod +x gradlew

The error is:

./gradlew build connectedCheck
: No such file or directory
The command "./gradlew build connectedCheck" exited with 127.
Done. Your build exited with 1.

Answer Source

Your gradlew file uses Windows style (CRLF) and Travis-ci runs on Linux that uses Unix style (LF).

Copy the gradlew file from a trusted project as

or change it using a text editor as vim and disable automatic conversion. Read this answer:

Source: Error with gradlew: /usr/bin/env: bash: No such file or directory

The problem's cause was that Git on Windows converted the line endings of gradlew from Unix style (LF) to Windows style (CRLF).

You can turn off that automatic conversion using:

git config core.autocrlf false

Setting the line endings of gradlew back to Unix style fixed the problem. In Vim this is done using:

set fileformat=unix

answered Mar 10 at 13:47 Matthias Braun

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download