sudo: required
dist: trusty

cache:
  directories:
    - node_modules
addons:
  apt:
    sources:
    - ubuntu-toolchain-r-test
    - google-chrome
    packages:
    - lib32stdc++6
    - lib32z1
before_install:
  - nvm install node
  - nvm use node
  - npm install -g cordova ionic
install:
  - npm install
before_script:
  - wget http://dl.google.com/android/android-sdk_r24.2-linux.tgz
  - tar -xvf android-sdk_r24.2-linux.tgz
  - echo y | ./android-sdk-linux/tools/android update sdk --no-ui --all --filter android-23,build-tools-23.0.1
  - export ANDROID_HOME=$PWD/android-sdk-linux
  - export PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools:$ANDROID_HOME/build-tools/23.0.2

script:
  - ionic platform remove android
  - ionic platform add android
  - ionic build android

sudo: required
dist: trusty

cache:
  directories:
    - node_modules
addons:
  apt:
    sources:
    - ubuntu-toolchain-r-test
    - google-chrome
    packages:
    - lib32stdc++6
    - lib32z1
before_install:
  - nvm install node
  - nvm use node
  - npm install -g cordova ionic
install:
  - npm install
before_script:
  - wget http://dl.google.com/android/android-sdk_r24.2-linux.tgz
  - tar -xvf android-sdk_r24.2-linux.tgz
  - echo y | ./android-sdk-linux/tools/android update sdk --no-ui --all --filter android-23,build-tools-23.0.1
  - export ANDROID_HOME=$PWD/android-sdk-linux
  - export PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools:$ANDROID_HOME/build-tools/23.0.2
  - mkdir -p ${ANDROID_HOME}/licenses
  - echo -e "\n8933bad161af4178b1185d1a37fbf41ea5269c55" > "${ANDROID_HOME}/licenses/android-sdk-license"
  - echo -e "\n84831b9409646a918e30573bab4c9c91346d8abd" > "${ANDROID_HOME}/licenses/android-sdk-preview-license"

script:
  - ionic platform remove android
  - ionic platform add android
  - ionic build android

Fix android build failing because of sdk license
Fix android build failing because of sdk license

