We\'re seeing a lot of build failures on the first and even second execution of pull requests for our Android project on Travis. However, if we restart the exact same build
You can set the environmental variable ADB_INSTALL_TIMEOUT
on Travis to a value such as 8 minutes to avoid this problem.
For example, in your .travis.yml:
language: android
jdk: oraclejdk7
# Turn off caching to avoid any caching problems
cache: false
# Use the Travis Container-Based Infrastructure
sudo: false
env:
global:
- ANDROID_API_LEVEL=21
- ANDROID_BUILD_TOOLS_VERSION=21.1.2
- ANDROID_ABI=armeabi-v7a
- ADB_INSTALL_TIMEOUT=8 # minutes (2 minutes by default)
android:
components:
- platform-tools
- tools
- build-tools-$ANDROID_BUILD_TOOLS_VERSION
- android-$ANDROID_API_LEVEL
The ShellCommandUnresponsiveException
is related to AOSP issue 69735: Ddmlib is too agressive with timeouts in Device.java, which causes ddmlib to timeout quickly if it doesn't receive input. The above environmental variable extends this timeout period on the Travis VM.
Also please be sure you're using the latest API level SDK and Build tools (at least the version above), since earlier versions don't allow setting this environmental variable.
Note that this may only resolve your problem if your tests occasionally pass on Travis - if your build always fails you may have other problems going on.
EDIT March 2016
Note that if you're still seeing failures, especially on API Level 23 emulator, there is another emulator timeout issue that may be causing you problems.
To get around this, you'll need to update your Gradle plugin to at least 2.0.0-beta3
- for example:
dependencies {
classpath 'com.android.tools.build:gradle:2.0.0-beta5'
}
For details see: