Why does Travis CI kill the process for my script?

萝らか妹 提交于 2019-12-24 14:09:07

问题


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


回答1:


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


来源:https://stackoverflow.com/questions/27377615/why-does-travis-ci-kill-the-process-for-my-script

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!