Is Android 28 emulator supported?

My .travis.yml:

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?

2 Likes

So, can you run emulator with x86 abi on API 26 without the next error “Please ensure KVM is properly installed and usable”?

Hmm… yes

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

I tried propably every possible combination to get newer Android SDK and Emulator to run on travis.
No luck.

  • Tried to use android container, but manually switching to use the new sdkmanager (didn’t work)
  • Tried different system images
  • Tried to use java container, downlad new android SDK manually
  • Tried different emulator settings / images

Nothing worked, I’m giving up. So no, the x86 emulators just wont run on Travis.

Right now, I’m switching to running the tests on Firebase Test Lab - as described here:

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