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

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:

According to 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:

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:

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:

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