I'm currently trying to get a travis.yml that works for Android 24 / build tools 24.0.3 and having some trouble.
I have the following for my travis.yml:
- ADB_INSTALL_TIMEOUT=20 # minutes (2 minutes by default)
- tools # to get the new `repository-11.xml`
- tools # to install Android SDK tools 25.1.x
# For Google APIs
# Support library
# Latest artifacts in local repository
# Specify at least one system image
- echo no | android create avd --force -n test -t "android-"$ANDROID_API_LEVEL --abi $ANDROID_ABI --tag $ANDROID_TAG
- emulator -avd test -no-skin -no-window &
- ./gradlew clean jacocoDebugTestReport
: No compatible devices connected.[TestRunner] FAILED Found 1 connected device(s), 0 of which were compatible. :app:connectedDebugAndroidTest FAILED
No output has been received in the last 10m0s, this potentially indicates a stalled build or something wrong with the build itself.
travis_wait followed by the desired minutes to wait to fix the second issue.
before_script: - echo no | android create avd --force -n test -t "android-"$ANDROID_API_LEVEL --abi $ANDROID_ABI --tag $ANDROID_TAG - emulator -avd test -no-skin -no-window & - android-wait-for-emulator - adb shell input keyevent 82 & script: - travis_wait 20 ./gradlew clean jacocoDebugTestReport
If you fix the first issue, probably you wont need the previous solution.
The line below is normally necessary, I didn't test it on android-24 and I would need to see a full log
- adb shell input keyevent 82 &
As a workaround, I would use a lower API level as suggested here until you find a better solution.
I have spent a lot of free time the last two years trying to find solutions to this type of issues and the best you can do is to use ci builds for lower APIs and devices or local tests for recent APIs.
The benefits of using latest APIs are not enough if you consider the time required to solve issues.