Android构建错误:未知的包过滤器

Mic*_*cky 7 continuous-integration android android-virtual-device travis-ci

更新: 可能有兴趣我也有类似的错误:
"错误:忽略未知的包过滤器'extra-android-m2repository'"在这一行:

android update sdk --filter extra-android-m2repository --no-ui --force > /dev/null  
Run Code Online (Sandbox Code Playgroud)

但是我通过将sdk工具更新为rev来解决了这个问题.23.原始错误仍然存​​在.


我有一个在travis.ci持续集成上运行的Android构建作业.它曾经是workefine,但最近它已经开始抛出一个错误:
"错误:忽略未知的包过滤器'sysimg-19'"

在这条线上:

echo yes | android update sdk --all --filter sysimg-19 --no-ui --force > /dev/null
Run Code Online (Sandbox Code Playgroud)

然后导致android create avd命令失败:
"有效ABI:没有ABI.错误:无效--aba armeabi-v7a用于所选目标."

我也尝试过没有--all标志,但它会导致相同的结果.
我想原因可能是我不知道的Android SDK中的一些变化.有没有人提示问题可能是什么?

请参阅下面的完整travis.yml.

Travis.yml:

language: java

jdk:
  - oraclejdk7

android:
  components:
    - build-tools-19.1.0

env:
  matrix:
    - ANDROID_TARGET=android-19  ANDROID_ABI=armeabi-v7a

before_install:
  # Install base Android SDK
  - sudo apt-get update -qq
  - if [ `uname -m` = x86_64 ]; then sudo apt-get install -qq --force-yes libgd2-xpm ia32-libs ia32-libs-multiarch > /dev/null; fi
  - wget http://dl.google.com/android/android-sdk_r22.6.2-linux.tgz
  - tar xzf android-sdk_r22.6.2-linux.tgz
  - export ANDROID_HOME=$PWD/android-sdk-linux
  - export PATH=${PATH}:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools

  # install android build tools
  - wget https://dl-ssl.google.com/android/repository/build-tools_r19.1-linux.zip
  - unzip build-tools_r19.1-linux.zip -d $ANDROID_HOME
  - mkdir -p $ANDROID_HOME/build-tools/
  - mv $ANDROID_HOME/android-4.4.2 $ANDROID_HOME/build-tools/19.1

  # Install required components.
  # For a full list, run `android list sdk -a --extended`
  # Note that sysimg-19 downloads only ARM, because only the first license query is accepted.
  - android list sdk -u --all --extended
  - echo yes | android update sdk --all --filter platform-tools --no-ui --force > /dev/null
  - echo yes | android update sdk --all --filter build-tools-19.1.0 --no-ui --force > /dev/null
  - echo yes | android update sdk --all --filter android-19 --no-ui --force > /dev/null
  - echo yes | android update sdk --all --filter sysimg-19 --no-ui --force > /dev/null
  - echo yes | android update sdk --filter extra-android-support --no-ui --force > /dev/null
  - echo yes | android update sdk --filter extra-android-m2repository --no-ui --force > /dev/null

  # Create and start emulator
  - echo no | android create avd --force -n test -t $ANDROID_TARGET --abi $ANDROID_ABI
  - emulator -avd test -no-skin -no-audio -no-window &

  - chmod +x gradlew

before_script:
  - adb wait-for-device
  - adb shell input keyevent 82 &

script:
  - TERM=dumb ./gradlew -s connectedCheck
Run Code Online (Sandbox Code Playgroud)

Mic*_*cky 3

我自己找到了一个解决方案:由于Android SDK中系统映像的重命名,该行

- echo yes | android update sdk --all --filter sysimg-19 --no-ui --force > /dev/null
Run Code Online (Sandbox Code Playgroud)

应该:

- echo yes | android update sdk --all --filter sys-img-armeabi-v7a-android-19 --no-ui --force > /dev/null
Run Code Online (Sandbox Code Playgroud)

当我将 sdk 工具更新到修订版 23 时,解决了 extra-android-m2repository 的另一个问题:

- wget http://dl.google.com/android/android-sdk_r23-linux.tgz
- tar xzf android-sdk_r23-linux.tgz
Run Code Online (Sandbox Code Playgroud)