# Install-missing-android-tools failing on license

**URL:** <https://discuss.bitrise.io/t/install-missing-android-tools-failing-on-license/7749>\
**Category:** Tooling Issues\
**Tags:** android\
**Created:** [January 18, 2019, 11:18pm UTC](https://discuss.bitrise.io/t/install-missing-android-tools-failing-on-license/7749 "2019-01-18T23:18:36Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![wbmoeller](https://avatars.discourse-cdn.com/v4/letter/w/df705f/32.png) [@wbmoeller](https://discuss.bitrise.io/u/wbmoeller)\
**Post date:** [January 18, 2019, 11:18pm UTC](https://discuss.bitrise.io/t/install-missing-android-tools-failing-on-license/7749/1 "2019-01-18T23:18:36Z")

</div>

The install-missing-android-tools build step started failing this morning when it gets to accepting licenses for build-tools 28.0.3. We upgraded our system for Android Studio 2.3.3 a few days ago.

```
Ensure required Android SDK components
Retrying...
Failed to ensure android components, error: output: Running exec java -Dorg.gradle.appname=gradlew - classpath /bitrise/src/gradle/wrapper/gradle-wrapper.jar org.gradle.wrapper.GradleWrapperMain dependencies --stacktrace
Parallel execution is an incubating feature.
> Configure project :hbmx
Checking the license for package Android SDK Build-Tools 28.0.3 in /opt/android-sdk-linux/licenses
Warning: License for package Android SDK Build-Tools 28.0.3 not accepted.
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':hbmx'.
> Failed to install the following Android SDK packages as some licences have not been accepted.
     build-tools;28.0.3 Android SDK Build-Tools 28.0.3
```

---

<div class="post-metadata">

**Author:** ![jason.atwood](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/jason.atwood/32/1712_2.png) [@jason.atwood](https://discuss.bitrise.io/u/jason.atwood)\
**Post date:** [January 19, 2019, 1:11am UTC](https://discuss.bitrise.io/t/install-missing-android-tools-failing-on-license/7749/2 "2019-01-19T01:11:07Z")

</div>

We went from 3.3.0-rc03 straight to 3.4.0-beta01 and now we are seeing this. Rolling back to 3.3.0-rc03 didn’t actually fix the problem.

---

<div class="post-metadata">

**Author:** ![rajivshah3](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/rajivshah3/32/1996_2.png) [@rajivshah3](https://discuss.bitrise.io/u/rajivshah3)\
**Post date:** [January 19, 2019, 9:03pm UTC](https://discuss.bitrise.io/t/install-missing-android-tools-failing-on-license/7749/3 "2019-01-19T21:03:37Z")

</div>

Running into the same issue with [this PR](https://github.com/rajivshah3/react-native-google-safetynet/pull/96) which upgrades Gradle from 3.1.4 to 3.3.0. My [logs](https://app.bitrise.io/build/e6225bc84beb5995) look pretty similar. This also happens if I change `compileSdkVersion` from 27 to 28.

I tried seeing if the issue was in the Dockerfile, but it looks like it’s correctly set to accept the license for build-tools 28.0.3: [https://github.com/bitrise-docker/android/blob/master/Dockerfile#L63](https://github.com/bitrise-docker/android/blob/master/Dockerfile#L63)

---

<div class="post-metadata">

**Author:** ![lafiosca](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/lafiosca/32/1997_2.png) [@lafiosca](https://discuss.bitrise.io/u/lafiosca)\
**Post date:** [January 20, 2019, 4:27am UTC](https://discuss.bitrise.io/t/install-missing-android-tools-failing-on-license/7749/4 "2019-01-20T04:27:09Z")

</div>

This started impacting our Android build today as well, and we haven’t changed anything about our build config/tools recently.

It looked to me similar to [this old issue from a year ago](http://discuss.bitrise.io/t/android-build-tools-26-0-2-license-agreement-not-accepted/2964/6). The comments there led me to look at [https://dl.google.com/android/repository/repository2-1.xml](https://dl.google.com/android/repository/repository2-1.xml) where it appears that the Android license was updated at `2019-01-18 13:05:43.965908` (yesterday). Our previous successful build was 3 days ago, so this seems potentially related.

The weird thing is that I would expect the current Docker image to still work, given [the PR that resolved the previous issue](https://github.com/bitrise-docker/android/pull/125) which appears to accept all licenses. I wonder if something changed about the `sdkmanager` tool.

I started trying to work around the problem briefly, but then I found this thread. I hope this can be resolved soon.

---

<div class="post-metadata">

**Author:** ![koral](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/koral/32/357_2.png) [@koral](https://discuss.bitrise.io/u/koral)\
**Post date:** [January 20, 2019, 6:09pm UTC](https://discuss.bitrise.io/t/install-missing-android-tools-failing-on-license/7749/5 "2019-01-20T18:09:42Z")

</div>

From what I can see indeed the main part of the issue is the same as in the old one. `android-sdk-license` license has changed.

As a workaround you can add script step with content like this before install-missing-android-tools step:  
`yes |sdkmanager --install "build-tools;28.0.3"`  
It will accept the license for both build tools 28.0.3 and platform 28.  
Or you can write the following content to `$ANDROID_HOME/licenses/android-sdk-license`:

```auto
8933bad161af4178b1185d1a37fbf41ea5269c55

d56f5187479451eabf01fb78af6dfcb131a6481e

24333f8a63b6825ea9c5514f83c2829b004d1fee

```

Another option (if it is suitable for your project) is to switch to normal (non-LTS) stack. It has those components preinstalled.

> [@lafiosca](#):
>
> The weird thing is that I would expect the current Docker image to still work,

Commands from Dockerfile are executed when docker image is built, not on each app build.

The difference from previous issue is that `sdkmanager --licenses` won’t accept the new license. So there is more work needed to properly fix the step.

---

<div class="post-metadata">

**Author:** ![lafiosca](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/lafiosca/32/1997_2.png) [@lafiosca](https://discuss.bitrise.io/u/lafiosca)\
**Post date:** [January 20, 2019, 6:56pm UTC](https://discuss.bitrise.io/t/install-missing-android-tools-failing-on-license/7749/6 "2019-01-20T18:56:04Z")

</div>

Thanks, @koral! I totally whiffed on the fact that the Docker build wouldn’t get regenerated. We switched to LTS after that NDK issue broke our build a few months ago, and it looks like other subsequent changes to our build config have made it possible for us to go back to the non-LTS image. I ran a successful build that I just need to go test out.

---

<div class="post-metadata">

**Author:** ![jason.atwood](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/jason.atwood/32/1712_2.png) [@jason.atwood](https://discuss.bitrise.io/u/jason.atwood)\
**Post date:** [January 22, 2019, 5:02pm UTC](https://discuss.bitrise.io/t/install-missing-android-tools-failing-on-license/7749/7 "2019-01-22T17:02:23Z")

</div>

Thanks @koral. Here is text to copy/paste into your bitrise.yml to easily implement @koral’s workaround

```
- script@1.1.5:
        inputs:
        - content: |-
            #!/usr/bin/env bash
            yes |sdkmanager --install "build-tools;28.0.3"
            # TEMP solution to accept latest build tools licenses
            # see http://discuss.bitrise.io/t/install-missing-android-tools-failing-on-license/7749/5
```

---

<div class="post-metadata">

**Author:** ![laszlo.pusok](https://avatars.discourse-cdn.com/v4/letter/l/e56c9b/32.png) [@laszlo.pusok](https://discuss.bitrise.io/u/laszlo.pusok)\
**Post date:** [January 23, 2019, 3:21pm UTC](https://discuss.bitrise.io/t/install-missing-android-tools-failing-on-license/7749/8 "2019-01-23T15:21:03Z")

</div>

Hi all!  
Thank you for the report and your patience.  
There is a new release (version 2.3.5: [https://github.com/bitrise-steplib/steps-install-missing-android-tools/releases/tag/2.3.5](https://github.com/bitrise-steplib/steps-install-missing-android-tools/releases/tag/2.3.5)) of install-missing-android-tools currently rolling out. Should be available everywhere by end of day.  
The root cause was this google issue, which had to be worked around: [https://issuetracker.google.com/issues/123054726](https://issuetracker.google.com/issues/123054726)

---

<div class="post-metadata">

**Author:** ![wbmoeller](https://avatars.discourse-cdn.com/v4/letter/w/df705f/32.png) [@wbmoeller](https://discuss.bitrise.io/u/wbmoeller)\
**Post date:** [January 25, 2019, 6:21am UTC](https://discuss.bitrise.io/t/install-missing-android-tools-failing-on-license/7749/9 "2019-01-25T06:21:05Z")

</div>

Thanks, the fixed install-missing-android-tools works for me. 🙂

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/bitrise/original/2X/d/d901cf2aad020f2dd11918afc89ec2089bb87b35.png) [@system](https://discuss.bitrise.io/u/system)\
**Post date:** [February 24, 2019, 6:21am UTC](https://discuss.bitrise.io/t/install-missing-android-tools-failing-on-license/7749/10 "2019-02-24T06:21:16Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
