Travis CI android-20 和 android-22 构建失败

Travis CI Build Fails for android-20 and android-22

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

Error: Invalid --tag default for the selected target.

The command "echo no | android create avd --force -n test -t $ANDROID_TARGET --abi $ANDROID_ABI" failed and exited with 1 during .

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

特拉维斯result

如何解决?

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