Unable to accept license for build-28.0.3 and android SDK 27

Link to Travis Log

Travis file

language: android
jdk: oraclejdk8

sudo: required
dist: precise

env:
  global:
    - ANDROID_API_LEVEL=27  # Compile SDK version
    - EMULATOR_API_LEVEL=19
    - ANDROID_BUILD_TOOLS_VERSION=28.0.3
    - ANDROID_ABI=armeabi-v7a
    - ANDROID_TAG=google_apis
    - ADB_INSTALL_TIMEOUT=20 # minutes (2 minutes by default)

android:
  components:
#    # latest version of the tools
#    - tools
#    - platform-tools

    # build tools version
    - build-tools-$ANDROID_BUILD_TOOLS_VERSION

    # The SDK Version
    - android-$ANDROID_API_LEVEL
    - android-$EMULATOR_API_LEVEL

    # For Google APIs
    - addon-google_apis-google-$ANDROID_API_LEVEL
    - addon-google_apis-google-$EMULATOR_API_LEVEL

    # Additional components
    - extra-google-m2repository
    - extra-android-m2repository

    # Emulator
    - sys-img-armeabi-v7a-google_apis-$EMULATOR_API_LEVEL

  licenses:
    # White list all android-sdk-license revisions.
    - 'android-sdk-license-.+'
    # White list all the licenses.
    - '.+'

#install:
#  - echo yes | ${ANDROID_HOME}/tools/bin/sdkmanager "platforms;android-27"


# Emulator Management: Create, Start and Wait
before_script:
  - echo no | android create avd --force -n test -t "android-"$EMULATOR_API_LEVEL --abi $ANDROID_ABI --tag $ANDROID_TAG
  - emulator -avd test -no-audio -no-window &
  - android-wait-for-emulator
  - adb shell input keyevent 82 &

#before_install:
#  - yes | sdkmanager "platforms;android-28" # Fails , no such command
#  - echo yes | sdkmanager "build-tools;28.0.3"  # Fails , no such command
#  - yes | sdkmanager "build-tools;28.0.3"   # Fails , no such command
#  - yes | sdkmanager --licenses

I have almost tried every way to fix this. For accepting the license, I’m getting below error.

$ yes | sdkmanager "build-tools;28.0.3"

/home/travis/.travis/functions: line 104: sdkmanager: command not found

The command "yes | sdkmanager "build-tools;28.0.3"" failed and exited with 127 during . 

If anyone can help. I would be thankful to him/her.

1 Like

I had the same issue and managed to solve it with solution from this article

@akshay-testpress, Have you been able to solve the problem?

I had the same problem, solved it by adding

dist : trusty

to the .travis.yml file

2 Likes

I can confirm that this works. But that definately shouldn’t be the solution as trusty just lost support xD

Yes I agree that Trusty Container Based Environment has lost support.
In my case, we are using the Linux based virtual environment. Therefore we can use the trusty distro for our purpose.

Hi,

I got it to work with xenial and level 28:#

os: linux
sudo: required
jdk: oraclejdk8


env:
  global:
  - ANDROID_API_LEVEL=28
  - ANDROID_BUILD_TOOLS_VERSION=28.0.3
  - ANDROID_ABI=armeabi-v7a

git:
  depth: 1

dist: xenial
addons:
  apt:
    sources:
      - sourceline: deb https://dl.yarnpkg.com/debian/ stable main
        key_url: https://dl.yarnpkg.com/debian/pubkey.gpg
    packages:
      - oracle-java8-installer
      - oracle-java8-set-default

language: android

android:
  components:
    - tools
    - platform-tools-28.0.2
    # The BuildTools version used by your project
    - build-tools-28.0.3

    # The SDK version used to compile your project
    - android-28

    # Additional components
    - extra-google-google_play_services
    - extra-google-m2repository
    - extra-android-m2repository

    # Specify at least one system image,
    # if you need to run emulator(s) during your tests
  licenses:
    - 'android-sdk-preview-license-52d11cd2'
    - 'android-sdk-license-.+'
    - 'google-gdk-license-.+'


before_cache:
  - rm -f  $HOME/.gradle/caches/modules-2/modules-2.lock
  - rm -fr $HOME/.gradle/caches/*/plugin-resolution/
cache:
  directories:
    - $HOME/.gradle/caches/
    - $HOME/.gradle/wrapper/
    - $HOME/.android/build-cache

before_install:
    #- touch $HOME/.android/repositories.cfg
    #- yes | sdkmanager "platforms;android-28"
    #- yes | sdkmanager "build-tools;28.0.3"
    - export LANG=en_US.UTF-8
    
script: 
  # See https://austinpray.com/ops/2015/09/20/change-travis-node-version.html

  # Clear out whatever version of NVM Travis has.
  # Their version of NVM is probably old.
   - rm -rf ~/.nvm

  # Grab NVM.
   - git clone https://github.com/creationix/nvm.git ~/.nvm 
  # Checkout the latest stable tag.
  # Note that you can just hardcode a preferred version here.
   - (cd ~/.nvm; git checkout `git describe --abbrev=0 --tags`)

  # Add nvm command available to shell
   - source ~/.nvm/nvm.sh

  # Install a lts version of Node
   - nvm install --lts
   - npm install -g ionic
   - npm install -g cordova
   - cd app
   - npm ci
   - ionic cordova platform add android
   - ionic cordova build android
  
branches:
  only:
    - master