Travis-ci command "./gradlew build" exited with 1
Asked Answered
R

3

11

I am unable to build my Android application with Travis-ci. It keeps failing with:

Travis-ci command "./gradlew build" exited with 1.

I have no idea what's causing this, and Travis-ci has no information on how to fix it!

Please advise, Igor

Recline answered 9/6, 2015 at 20:2 Comment(0)
R
11

For anyone who is interested, I used the following android components section in my travis.yml file to solve the problem:

android:
  components:
    # Update Android SDK Tools
    - tools

    - build-tools-23.0.1
    - android-23

    # Support library
    - extra-android-support
    - extra-android-m2repository

Also, my script section has the following:

script:
- chmod +x ./gradlew

Seems to work now!

Recline answered 27/12, 2015 at 16:20 Comment(5)
Not working for me !! any suggestions what I could be doing wrong - chmod: cannot access ‘./gradlew’: No such file or directory The command "chmod +x ./gradlew" failed and exited with 1 during .Hereon
@Hereon Did you set up a standard android proj. on Travis CI?Recline
I am not sure what standard means here ! I have a native android studio project that m trying to set up on Travis CIHereon
Assuming you followed this document fully: docs.travis-ci.com/user/languages/androidRecline
Silly mistake was returning true before - chmod +x ./gradlew. thanks for your helpHereon
I
2

hi i also have the same issue but the above solution was not working in my case.But if fix it by giving

before_install:
- chmod +x gradlew

After applying chmode on before_install i have resolved the issue.

Complete .travis.yml

language: android
android:
components:
# Uncomment the lines below if you want to
# use the latest revision of Android SDK Tools
# - platform-tools
# - tools

# The BuildTools version used by your project
- build-tools-25.0.0

# The SDK version used to compile your project
- android-25


# Specify at least one system image,
# if you need to run emulator(s) during your tests
- sys-img-armeabi-v7a-android-22
- sys-img-armeabi-v7a-android-17

before_install:
- chmod +x gradlew

I hope this will help anyone who fail to get the solution from the above answer.

Incorruption answered 20/12, 2016 at 7:5 Comment(0)
H
2

I had to set the jdk in the second line to 8 and it works:

language: android
jdk: oraclejdk8
android:
...
Hermaphrodite answered 2/3, 2017 at 22:46 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.