Travis CI Build为android-20和android-22失败

时间:2016-05-07 23:05:11

标签: android travis-ci android-5.1.1-lollipop

我想测试我的代码从android-15到android-23,但不幸的是android-20和android-22的构建失败。

  

错误:无效 - 所选目标的默认值。

     

命令“echo no | android create avd --force -n test -t   $ ANDROID_TARGET --abi $ ANDROID_ABI“失败并在1期间退出。

travis文件:

language: android
sudo: false
jdk: oraclejdk7
os:
  - linux
android:
  components:
    - platform-tools
    - tools
    - build-tools-23.0.3
    - android-23
    # Additional components
    - extra
    - extra-google-m2repository
    - extra-android-m2repository
    - extra-android-support
    # Images
    - sys-img-${ANDROID_ABI}-${ANDROID_TARGET}

env:
  matrix:
    - ANDROID_SDKS=android-15 ANDROID_TARGET=android-15 ANDROID_ABI=armeabi-v7a
    - ANDROID_SDKS=android-16 ANDROID_TARGET=android-16 ANDROID_ABI=armeabi-v7a
    - ANDROID_SDKS=android-17 ANDROID_TARGET=android-17 ANDROID_ABI=armeabi-v7a
    - ANDROID_SDKS=android-18 ANDROID_TARGET=android-18 ANDROID_ABI=armeabi-v7a
    - ANDROID_SDKS=android-19 ANDROID_TARGET=android-19 ANDROID_ABI=armeabi-v7a
    - ANDROID_SDKS=android-20 ANDROID_TARGET=android-20 ANDROID_ABI=armeabi-v7a
    - ANDROID_SDKS=android-21 ANDROID_TARGET=android-21 ANDROID_ABI=armeabi-v7a
    - ANDROID_SDKS=android-22 ANDROID_TARGET=android-22 ANDROID_ABI=armeabi-v7a
    - ANDROID_SDKS=android-23 ANDROID_TARGET=android-23 ANDROID_ABI=armeabi-v7a


  global:
      # wait up to 10 minutes for adb to connect to emulator
      - ADB_INSTALL_TIMEOUT=10

cache:
  directories:
    - $HOME/.gradle/caches/2.10
    - $HOME/.gradle/caches/jars-1
    - $HOME/.gradle/daemon
    - $HOME/.gradle/native
    - $HOME/.gradle/wrapper

before_install:
  - chmod +x gradlew

before_script:
  - echo no | android create avd --force -n test -t $ANDROID_TARGET --abi $ANDROID_ABI
  - emulator -avd test -no-skin -no-audio -no-window &

script:
  - android-wait-for-emulator
  - adb devices
  - adb shell setprop dalvik.vm.dexopt-flags v=n,o=v
  - adb shell input keyevent 82 &
  - ./gradlew connectedCheck

travis result

如何解决?

1 个答案:

答案 0 :(得分:1)

Android 20 SDK目标适用于KitKat4.4可穿戴设备,并且系统图像略有不同,abi前缀导致错误。

在#images下,您可以添加Travis-CI提供的图像

- sys-img-armeabi-v7a-android-wear-20

在android 20矩阵脚本中,你必须添加android-wear / armeabi-v7

- ANDROID_SDKS=android-20 ANDROID_TARGET=android-20 ANDROID_ABI=android-wear/armeabi-v7a