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.

2 Answers 2

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

2
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

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.