Dieter Adriaenssens: Travis and Android

If you're looking to build your Android app on Travis CI, using SDK r22.2.1 and API 18 (Android 4.3), put this in configuration file .travis.yml :

language: java

before_install:

  # install ia32-libs

  - 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; fi

  # download the latest android sdk and unzip

  - wget http://dl.google.com/android/android-sdk_r22.2.1-linux.tgz

  - tar -zxf android-sdk_r22.2.1-linux.tgz

  - export ANDROID_HOME=`pwd`/android-sdk-linux

  - export PATH=${PATH}:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools

  # only update the sdk for the tools and platform-tools (1,2) and whatever api level

  # you are building for android (run "android list sdk" to get the full list.

  - echo "y" | android update sdk --filter 1,2,4 --no-ui --force

Up to date version is here.

What it does (and why):

  • The Travis virtual machines are running 64 bit kernels, but the Android SDK needs 32 bit, so ia32-libs is needed.
  • The Android SDK is not installed on the Travis instance, so you need to download and install it yourself.
  • Update the tools and platform-tools (position 1 and 2) and API 18 (currently position 4)
  • There is no command line option to accept the license, so piping a "y" to the installer is necessary. Please note : if you have to accept multiple licences, this will not work.

Thanks to Levi Wilson and Ralf Kistner for inspiration to get it working.
link

Posted by SourceForge Robot 2013-10-07