I'm trying to set up my CI for a Android project that uses some C++ code. As such I need the NDK that doesn't come pre-installed on Travis Android images. I'm currently achieving this by pulling the NDK myself, however my CI box is complaining about the CMake license not being accepted. The weird thing is that I thought this was included in the android-sdk-license which I am already including in my build. My travis YAML looks like this:
language: android
jdk:
- oraclejdk8
- oraclejdk9
android:
components:
- tools
- platform-tools
- tools
- build-tools-26.0.2
- android-26
- extra-android-m2repository
- extra-google-m2repository
- extra-android-support
- extra-google-google_play_services
- add-on
- extra
licenses:
- 'android-sdk-preview-license-.+'
- 'android-sdk-license-.+'
before_script:
- wget https://dl.google.com/android/repository/android-ndk-r16b-linux-x86_64.zip
- unzip -qq android-ndk-r16b-linux-x86_64.zip
- export ANDROID_NDK_HOME=`pwd`/android-ndk-r16b
- export LOCAL_ANDROID_NDK_HOME="$ANDROID_NDK_HOME"
- export LOCAL_ANDROID_NDK_HOST_PLATFORM="linux-x86_64"
- export PATH=$PATH:${ANDROID_NDK_HOME}
- env
script: ./gradlew build jacocoTestReport
matrix:
fast_finish: true
allow_failures:
- jdk: oraclejdk9
notifications:
email: false
after_success:
— bash <(curl -s https://codecov.io/bash)
The license error can be seen at the bottom of the build here
I didn't try it but perhaps it's similar to the constraint library related issue.
As explained here and here, use a workaround to solve license issues or directly download it:
Yes, you can use the new
sdkmanager
to install the constraint library and accept the license:In your case, check the correct version for
cmake
like here and here,cmake;3.6.4111459
:Otherwise, the missing component will be detected by
gradle
and downloaded without accept it:In that case, as explained here, you need to accept the license the first time via the workaround:
Before android script deprecation, you can accept all the licenses at the same time like this:
I think that if you remove licenses section, 'white list all the licenses'
- '.+'
is applied by default.This is currently working for me:
My .travis.yml is available here.
Looks like the NDK samples use travis, maybe look there to see what's missing from your build: https://github.com/googlesamples/android-ndk/blob/master/.travis.yml