Issue
I'm trying to setup gitlab CI and I can't find any information about error which I'm getting from gitlab runner. Here is .yml file :
image: openjdk:8-jdk
variables:
ANDROID_COMPILE_SDK: "28"
ANDROID_BUILD_TOOLS: "28.0.3"
ANDROID_SDK_TOOLS: "28.0.3"
before_script:
- apt-get --quiet update --yes
- apt-get --quiet install --yes wget tar unzip lib32stdc++6 lib32z1
- wget --quiet --output-document=android-sdk.zip
https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip
- unzip -q android-sdk.zip -d android-sdk-linux
- echo y | android-sdk-linux/tools/android --silent update sdk --no-ui -- all
--filter android-${ANDROID_COMPILE_SDK}
- echo y | android-sdk-linux/tools/android --silent update sdk --no-ui --all
--filter platform-tools
- echo y | android-sdk-linux/tools/android --silent update sdk --no-ui --all
--filter build-tools-${ANDROID_BUILD_TOOLS}
- echo y | android-sdk-linux/tools/android --silent update sdk --no-ui --all
--filter extra-android-m2repository
- echo y | android-sdk-linux/tools/android --silent update sdk --no-ui --all
--filter extra-google-google_play_services
- echo y | android-sdk-linux/tools/android --silent update sdk --no-ui --all
--filter extra-google-m2repository
- export ANDROID_HOME=$PWD/android-sdk-linux
- export PATH=$PATH:$PWD/android-sdk-linux/platform-tools/
- chmod +x ./gradlew
stages:
- build
- test
build:
stage: build
script:
- ./gradlew assembleDebug
artifacts:
paths:
- app/build/outputs/
And finaly error is:
Processing triggers for libc-bin (2.24-11+deb9u3) ...
$ wget --quiet --output-document=android-sdk.zip
https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip
$ unzip -q android-sdk.zip -d android-sdk-linux
$ echo y | android-sdk-linux/tools/android --silent update sdk --no-ui --all
--filter android-${ANDROID_COMPILE_SDK}
*************************************************************************
The "android" command is deprecated.
For manual SDK, AVD, and project management, please use Android Studio.
For command-line tools, use tools/bin/sdkmanager and tools/bin/avdmanager
*************************************************************************
Unrecognized argument --silent
ERROR: Job failed: exit code 1
What should I do in this case? Can't find any information about this. I have tried to change path but won't help.
Solution
If you want just build your project (with unit tests stage) you can try simple gitlab CI script which i'm using in my project gitlab snippet.
I'm not sure that this will work with build tools version 28, but you can experiment with this params.
Answered By - Denis V
Answer Checked By - David Marino (JavaFixing Volunteer)