JJD
JJD

Reputation: 51844

Why does Travis CI kill the process for my script?

I added the following configuration to run Travis CI on the Fahrplan Android project:

language: android

android:
  components:

  # All the build system components should be at the latest version
  # - tools
  # - platform-tools
  - build-tools-21.1.1
  - android-19
  - sysimg-19
  - add-on
  - extra

  # The libraries we can't get from Maven Central or similar
  - extra-android-support
  - extra-android-m2repository

jdk:
  - oraclejdk7
  - openjdk7

notifications:
  email: true

before_script:
  - chmod +x gradlew
  - mv app/gradle.properties.example app/gradle.properties

script:
  - ./gradlew clean assembleDebug

For some reason the process gets killed again and again as can be seen in the build history. It stops at different locations. The error message is not that informative:

The command "./gradlew clean assembleDebug" exited with 137

Upvotes: 1

Views: 1054

Answers (1)

albodelu
albodelu

Reputation: 7971

Only checking the gradle version you can force the download before you run the script (helps me to avoid error 137) but now i use wrapper so gradle-wrapper.jar is updated.

If it doesn't work, you can try to download the android dependencies before to run the script and clean before too.

I think they don't assemble by default but I like to override install stage to be sure.

In my case, error 137 is due concurrency (build/emulator) and jobs killed by Travis-ci. I solve it doing changes of this type and I don't understand it very well.

language: android

jdk:
  - oraclejdk7
  - openjdk7

android:
  components:

    # All the build system components should be at the latest version
    - tools
    - platform-tools
    - build-tools-21.1.1
    - android-19

    # The libraries we can't get from Maven Central or similar
    - extra-android-support
    - extra-android-m2repository


notifications:
  email: true

before_install:
  # Disable services enabled by default
  # http://docs.travis-ci.com/user/database-setup/#MySQL
  - sudo /etc/init.d/mysql stop
  - sudo /etc/init.d/postgresql stop
  # The following did not work reliable
  # - sudo service mysql stop
  # - sudo service postgresql stop

install:
  # Ensure Gradle wrapper is executable, download wrapper and show version
  - chmod +x ./gradlew; ls -l gradlew; ./gradlew wrapper -v
  # Download and show android dependencies
  # - ./gradlew androidDependencies

before_script:        
  # Ensure signing configuration is present
  - mv app/gradle.properties.example app/gradle.properties

script:
  - ./gradlew clean assembleDebug

Upvotes: 2

Related Questions