8

Reference build: https://travis-ci.org/ameer1234567890/Cevapr/builds/42053662

My .travis.yml is:

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

before_script:
  - 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.
Ameer
  • 978
  • 4
  • 13
  • 34

2 Answers2

6

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 https://github.com/google/iosched/blob/master/gradlew

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

Community
  • 1
  • 1
albodelu
  • 7,931
  • 7
  • 41
  • 84
  • Try this, .vimrc file http://unix.stackexchange.com/questions/44616/why-is-vim-creating-files-with-dos-line-endings and file location http://vim.wikia.com/wiki/Open_vimrc_file – albodelu Jun 11 '15 at 06:34
  • adding --global worked for me, git config --global core.autocrlf false – Devashish Mamgain Aug 13 '15 at 14:33
0

I found the answer here, It helped me
and below is modification of this file

language: android
android:
  components:
    - tools
    - build-tools-24.0.1
    - android-24
    - platform-tools
    - extra-android-support # because I'm use support library
    - extra-android-m2repository # because I'm use support library
  licenses:
    - '.+'

sudo: required

jdk:
  - oraclejdk8

install: true

before_script:
  - chmod +x gradlew

script:
  - ./gradlew assembleRelease --stacktrace
TarikW
  • 359
  • 4
  • 12