在Travis CI中启动Android x86模拟器时出错

unc*_*tex 12 android travis-ci

我跑的时候

android connectedCheck
Run Code Online (Sandbox Code Playgroud)

在Travis中使用ARM模拟器,构建通常以超时错误结束.所以我试图用x86模拟器运行我的构建和测试.但是当我运行命令时:

emulator -avd test -no-skin -no-audio -no-window &
Run Code Online (Sandbox Code Playgroud)

我收到此错误:

emulator: ERROR: x86 emulation currently requires hardware acceleration!
Please ensure KVM is properly installed and usable.
CPU acceleration status: KVM is not installed on this machine (/dev/kvm is missing).
Run Code Online (Sandbox Code Playgroud)

我在Travis CI文档中注意到,似乎确实支持x86模拟器,所以我认为它是可能的.但我一直无法找到任何关于让它们与硬件加速一起正常工作的参考.我也试过运行这个命令:

sudo apt-get install qemu-kvm libvirt-bin ubuntu-vm-builder bridge-utils
Run Code Online (Sandbox Code Playgroud)

在创建模拟器之前,我仍然得到相同的错误.

这是我的.travis.yml脚本:

language: android
jdk: oraclejdk7

env:
  global:
    - ANDROID_BUILD_API_LEVEL=22
    - ANDROID_BUILD_TOOLS_VERSION=22.0.1
    - ANDROID_ABI=default/x86
    - ANDROID_EMULATOR_API_LEVEL=19

android:
  components:
    #- platform-tools
    #- tools
    - build-tools-$ANDROID_BUILD_TOOLS_VERSION
    - android-$ANDROID_BUILD_API_LEVEL
    - android-$ANDROID_EMULATOR_API_LEVEL

    - addon-google_apis_x86-google-$ANDROID_EMULATOR_API_LEVEL

    - extra-google-google_play_services
    - extra-android-support
    - extra-google-m2repository
    - extra-android-m2repository

    - sys-img-x86-android-$ANDROID_EMULATOR_API_LEVEL

notifications:
  email: true

before_script:
  - sudo apt-get update -qq
  - sudo apt-get install -qq libstdc++6:i386 lib32z1 expect
  # for gradle output style
  - export TERM=dumb

  # environment info
  - ./gradlew -v
  - uname -a

  # emulator
  - echo no | android create avd --force -n test -t "Google Inc.:Google APIs (x86 System Image):"$ANDROID_EMULATOR_API_LEVEL --abi $ANDROID_ABI
  - emulator -avd test -no-skin -no-audio -no-window &
  - android-wait-for-emulator
  - adb shell input keyevent 82 &

# build
script:
  - ./gradlew clean connectedCheck -PdisablePreDex
Run Code Online (Sandbox Code Playgroud)

有没有人以前有这个工作?

tas*_*iac 8

英特尔模拟器尚未在Travis上运行.由于Travis运行虚拟机,因此在其他虚拟机中虚拟机中的硬件加速是一件困难的事情.

您现在必须运行ARM模拟器.

他们可能会在不久的将来做到这一点.订阅此问题以获得通知. https://github.com/travis-ci/travis-ci/issues/1419