Travis CI stuck in running build tools on Android

I am trying to add Travis CI to my Android project to run tests for me. Currently, I'm just trying to use CI to create and clean my project, but it doesn’t work, it seems to freeze after a while and is repeated endlessly in the logs before it eventually crashes. Here is an example log: https://gist.github.com/AdamMc331/6da4433a047815d8e072bf2b7fb81a44

I am completely puzzled by this. I do not know what the problem is. Below is my .travis.yml file:

language: android android: components: - tools - platform-tools - build-tools-25.0.2 - extra-android-m2repository - extra-android-support - android-25 jdk: - oraclejdk8 script: - chmod +x gradlew - ./gradlew clean build --stacktrace --info licenses: - android-sdk-license-.+ notifications: email: false sudo: false cache: directories: - $HOME/.gradle 

I tried adding --debug to the gradle task, but that didn't help. After the file hits the line “try to run build tools”, there are no more [DEBUG] instructions.

If someone wants to fork the project and try it for themselves, I use the CC-46 branch: https://github.com/AdamMc331/CashCaretaker/tree/feature/CC-46 If you look in the settings.gradle file you will notice that I use only utility and app-v2 modules.

Here is the log file when I run these commands locally in my terminal: https://gist.github.com/AdamMc331/6d0d0575aa170a760c84ad3244aed1b7

You can see that he also tries to run the build tools there, but he does not try 15 times, and ultimately it will work without errors. The travis construct should do something else.

+8
android travis-ci
source share
2 answers

Travis CI can kill gradle, if the build process gets too intense, you can increase memory and add some performance improvements. Check if this works.

Try this in the gradle.properties file:

 ## Project-wide Gradle settings. # # For more details on how to configure your build environment visit # http://www.gradle.org/docs/current/userguide/build_environment.html # # The Gradle daemon aims to improve the startup and execution time of Gradle. # When set to true the Gradle daemon is to run the build. org.gradle.daemon=true # # Specifies the JVM arguments used for the daemon process. # The setting is particularly useful for tweaking memory settings. # Default value: -Xmx10248m -XX:MaxPermSize=256m org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 # # When configured, Gradle will run in incubating parallel mode. # This option should only be used with decoupled projects. More details, visit # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects org.gradle.parallel=true # # Enables new incubating mode that makes Gradle selective when configuring projects. # Only relevant projects are configured which results in faster builds for large multi-projects. # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:configuration_on_demand org.gradle.configureondemand=true 

Edit: Try lowering your gradle from 3.3.0 to 2.2.3, as it does not compile in my projects.

+2
source share

I found some differences between your .travis.yml and working samples. Try the following:

 language: android android: components: - tools - build-tools-25.0.2 - android-25 - platform-tools - extra-android-support - extra-google-google_play_services - extra-android-m2repository - extra-google-m2repository licenses: - '.+' sudo: required jdk: - oraclejdk8 before_script: - chmod +x gradlew script: - ./gradlew clean build --stacktrace --info 

I think the problem may be related to a license check or a sudo or (less expected) script requirement.

+2
source share

All Articles