I got build failed with an exception when CircleCI run the command
gradle -dependencies
which is:
FAILURE: Build failed with an exception.
What went wrong:
A problem occurred configuring project ‘:app’.
Your SDK installation is missing the following SDK components required to build this project:
[Android SDK Build-Tools 24, Android SDK Platform 24].
Normally these can be installed automatically by the build system if
you’ve already agreed to the license terms while running Android Studio.
However, one or more licenses required by these components has not yet
been reviewed and accepted, so to build this project, open Android Studio,
go to the SDK Manager and install these components.
here is my configuration in .yml file:
machine:
java:
version: oraclejdk8
environment:
ANDROID_HOME: /usr/local/android-sdk-linux
dependencies:
pre:
- echo y | android update sdk --no-ui --all --filter “tools”
- echo y | android update sdk --no-ui --all --filter “platform-tools”
- echo y | android update sdk --no-ui --all --filter “build-tools”
- echo y | android update sdk --no-ui --all --filter “android-24”
- echo y | android update sdk --no-ui --all --filter “extra-google-m2repository”
- echo y | android update sdk --no-ui --all --filter “extra-google-google_play_services”
- echo y | android update sdk --no-ui --all --filter “extra-android-support”
- echo y | android update sdk --no-ui --all --filter “extra-android-m2repository”
checkout:
post:
- git submodule init
- git submodule update
test:
override:
- (./gradlew assemble -PdisablePreDex):
timeout: 360
- cp -r ${HOME}/${CIRCLE_PROJECT_REPONAME}/app/build/outputs/apk/ $CIRCLE_ARTIFACTS
- emulator -avd circleci-android22 -no-audio -no-window:
background: true
parallel: true
# wait for it to have booted
- circle-android wait-for-boot
# run tests against the emulator.
- ./gradlew connectedAndroidTest
deployment:
staging:
branch: staging
commands:
- (./gradlew clean assembleStaging crashlyticsUploadDistributionStaging -PdisablePreFex):
timeout: 720
I checked on the CircleCI web console when the command:
echo y | android update sdk --no-ui --all --filter “android-24”
is run. It seems to be OK. Here is the last result.
November 20, 2015
Do you accept the license ‘android-sdk-license-c81a61d9’ [y/n]:
Installing Archives:
Preparing to install archives
Downloading SDK Platform Android N, API 24, revision 1
Installing SDK Platform Android N, API 24, revision 1
Installed SDK Platform Android N, API 24, revision 1
Done. 1 package installed.
Have anyone faced with this problem before? Could you guys share some ideas?
Thanks.