language: android
sudo: true
git:
depth: 3
android:
components:
- tools
- tools
- platform-tools
- build-tools-28.0.3
# The SDK version used to compile your project
- android-28
# Additional components
- extra-google-google_play_services
- extra-google-m2repository
- extra-android-m2repository
# Specify at least one system image,
# if you need to run emulator(s) during your tests
- sys-img-x86-android-28
install:
- echo y | sdkmanager "ndk-bundle"
- echo y | sdkmanager "platforms;android-28"
before_script:
- wget https://s3.amazonaws.com/download.onnx/models/opset_9/squeezenet.tar.gz && tar xf squeezenet.tar.gz
- export ANDROID_NDK_HOME=$ANDROID_HOME/ndk-bundle
- android list targets
- echo no | android create avd --force -n test -t android-28 --abi x86
- emulator -avd test -no-skin -no-audio -no-window &
- android-wait-for-emulator
- adb shell input keyevent 82 &
I got the error:
emulator: WARNING: the -no-skin flag is obsolete. to have a non-skinned virtual device, create one through the AVD manager
emulator: ERROR: This AVD's configuration is missing a kernel file! Please ensure the file "kernel-qemu" is in the same location as your system image.
emulator: ERROR: ANDROID_SDK_ROOT is undefined
but the output of android list targets seems correct
$ android list targets
Available Android targets:
----------
id: 1 or "android-25"
Name: Android 7.1.1
Type: Platform
API level: 25
Revision: 3
Skins: HVGA, QVGA, WQVGA400, WQVGA432, WSVGA, WVGA800 (default), WVGA854, WXGA720, WXGA800, WXGA800-7in
Tag/ABIs : no ABIs.
----------
id: 2 or "android-28"
Name: Android 9
Type: Platform
API level: 28
Revision: 6
Skins: HVGA, QVGA, WQVGA400, WQVGA432, WSVGA, WVGA800 (default), WVGA854, WXGA720, WXGA800, WXGA800-7in
Tag/ABIs : default/x86
If I change 28 to 26, it works correctly.
So is android 28 emulator not supported by travis ci?
I tried to run android emulator with x86 on Travis but got error : “Please ensure KVM is properly installed and usable”. I find the issue with this problem, I understand that not possible run x86 build on Travis Add KVM support
It strange that it works in your case… Can you share more details? Maybe you can run tests on emulator or something?
Android emulators not starting for the last few days? (late March 2019) - the canary emulator will run x86_64 without accel now but API28 is failing due to some ADB issue (a timeout I think). APIQ isn’t starting yet, but everything from API16 to API27 except API19 works in that link
But, the x86 emulators do work. I have a working example.
I just don’t have the newest APIs (API28+) working, because ddmlib times out while loading APKs.
But I’ve seen a thread somewhere that indicates you can snag the ddmlib source code (which I’ve done) and you can hack it a bit (which I have not done) to extend the timeouts.
At which point even the newer APIs should work.
You can see here: proof, with open source goodness so you can share and enjoy https://travis-ci.org/ankidroid/Anki-Android/builds/516486599
follow the links there it’s all open source work. the current Anki-Android .travis.yml even has matrices done correctly so we can start testing modern JDKs with acceptable failures so they don’t fail the whole build
Fixed that by calling the emulator directly (use the one in $ANDROID_HOME/emulator, not the one in tools/, as your config suggests). Now the same old, same old KVM error:
emulator: ERROR: x86_64 emulation currently requires hardware acceleration!
To all: Trying to use Mike’s config please note that some scripts are located in his app’s repository. E.g. “./tools/android-wait-for-emulator.sh” is in the “tools” folder of the repository ( https://github.com/ankidroid/Anki-Android/tree/master/tools ) although it looks like Android system’s or Travis’s own tool :-).
I spent some time figuring this out…