Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android build error: unknown package filter

update: Might be of interest that I also got a similar error:
"Error: Ignoring unknown package filter 'extra-android-m2repository'" on this line:

android update sdk --filter extra-android-m2repository --no-ui --force > /dev/null  

but I resolved that one by updating the sdk tools to rev. 23. The original error stays though.


I have an Android build job running on travis.ci continuous integration. It used to workefine, but recently it has started throwing an error:
"Error: Ignoring unknown package filter 'sysimg-19'"

on this line:

echo yes | android update sdk --all --filter sysimg-19 --no-ui --force > /dev/null

which then leads to the android create avd command to fail with:
"Valid ABIs: no ABIs. Error: Invalid --abi armeabi-v7a for the selected target."

I also tried it without the --all flag, but it leads to the same result.
I suppose the cause may be some changes in the Android SDK I am not aware of. Does anyone have a hint what the problem may be?

See my full travis.yml below.

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
like image 687
Micky Avatar asked Jul 01 '14 13:07

Micky


1 Answers

I found a solution myself: Due to renaming of system images in the Android SDK the line

- echo yes | android update sdk --all --filter sysimg-19 --no-ui --force > /dev/null

should be:

- echo yes | android update sdk --all --filter sys-img-armeabi-v7a-android-19 --no-ui --force > /dev/null

To fix the other issue with extra-android-m2repository was solved when I updated the sdk tools to revision 23:

- wget http://dl.google.com/android/android-sdk_r23-linux.tgz
- tar xzf android-sdk_r23-linux.tgz
like image 101
Micky Avatar answered Oct 07 '22 01:10

Micky