Android Build Tools 26.0.2 license agreement not accepted

We updated to build tools 26.0.2 on 4th October, and all builds since then have worked - but this morning builds started failing. The Install Missing Android Tools build step is failing with:

File /root/.android/repositories.cfg could not be loaded.
Checking the license for package Android SDK Build-Tools 26.0.2 in /opt/android-sdk-linux/licenses
Warning: License for package Android SDK Build-Tools 26.0.2 not accepted.
FAILURE: Build failed with an exception.

  • What went wrong:
    A problem occurred configuring project ‘:app’.

You have not accepted the license agreements of the following SDK components:
[Android SDK Build-Tools 26.0.2].
Before building your project, you need to accept the license agreements and complete the installation of the missing components using the Android Studio SDK Manager.
Alternatively, to learn how to transfer the license agreements from one workstation to another, go to http://d.android.com/r/studio-ui/export-licenses.html

Licenses have been exported and copied in as a workaround, but the same error is occurring.
The stack is Android & Docker, on Ubuntu 16.04. All builds steps are at the latest version. Previously successfully building branches are also now failing, even though they have not been changed.

Has something changed with the VM?

An issue has been opened on the Install Missing Android Tools Github repo: https://github.com/bitrise-steplib/steps-install-missing-android-tools/issues/22

According to https://dl.google.com/android/repository/repository2-1.xml Android SDK license has changed on 2017-10-10 17:06:30. So previous agreement is not valid.
There is already a PR in docker image repo: https://github.com/bitrise-docker/android/pull/124/commits/53defa46d5e07e16fcebf33590be588413935e99#diff-3254677a7917c6c01f55212f86c57fbfR41

Something similar can be done for Install missing Android tools step.
As a workaround you can e.g. accept licenses manually in script step.

Looks like there is a PR for the Install Missing Android Tools build step too: https://github.com/bitrise-steplib/steps-install-missing-android-tools/pull/21

I’ve worked around this by adding the hash from the build-step PR to my exported android licenses.

Fix is on its way, should be released soon: https://github.com/bitrise-steplib/steps-install-missing-android-tools/pull/23

Sorry for the inconvenience - we’ll do a revision on the license handling code in the step once the quickfix is released, to avoid similar issues in the future.

1 Like

Fix is released:

1 Like