# Circleci android accept licenses

**URL:** <https://discuss.circleci.com/t/circleci-android-accept-licenses/19369>\
**Category:** Mobile\
**Created:** [January 15, 2018, 6:17pm UTC](https://discuss.circleci.com/t/circleci-android-accept-licenses/19369 "2018-01-15T18:17:34Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![DanielMartinus](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/danielmartinus/32/10460_2.png) [@DanielMartinus](https://discuss.circleci.com/u/DanielMartinus)\
**Post date:** [January 15, 2018, 6:17pm UTC](https://discuss.circleci.com/t/circleci-android-accept-licenses/19369/1 "2018-01-15T18:17:34Z")

</div>

I saw that this question has been posted numerous times on this website but also others. There seems to be a broad problem with accepting the licenses in Android. And currently this is witholding me in using CircleCI.

This is how the first part of my .yaml config looks like:

```
version: 2.0

defaults: &defaults
  docker:
    - image: circleci/android:api-27-alpha
  working_directory: ~/ninetydays
  environment:
    _JAVA_OPTIONS: "-Xmx1400m"
    TERM: dumb

update_sdk: &update_sdk
  name: Update SDK
  command: |
    mkdir -p "$ANDROID_HOME/licenses" || true
    rsync -avhP ./android-licenses/ "$ANDROID_HOME/licenses/"

jobs:
  build:
    <<: *defaults
    steps:
      - run:
          <<: *update_sdk
      - checkout

```

I got a directory in my project with the latest hashes of the licenses for Android. But even though I copy them to the license directory I still get the following error:

```
Checking the license for package Android SDK Build-Tools 26.0.2 in /usr/local/android-sdk-
linux/licenses
Warning: License for package Android SDK Build-Tools 26.0.2 not accepted.
Checking the license for package Android SDK Platform 27 in /usr/local/android-sdk-linux/licenses
Warning: License for package Android SDK Platform 27 not accepted.

* 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, Android SDK Platform 27].

```

I’ve also tried the following update\_sdk command:

```
update_sdk: &update_sdk
  name: Update SDK
  command: |
    mkdir -p "$ANDROID_HOME/licenses" || 
    echo -e "\n8933bad161af4178b1185d1a37fbf41ea5269c55" > "$ANDROID_SDK/licenses/android-sdk-license"
    echo -e "\nd56f5187479451eabf01fb78af6dfcb131a6481e" >> "$ANDROID_SDK/licenses/android- sdk-license"
    echo -e "\n84831b9409646a918e30573bab4c9c91346d8abd" >>"$ANDROID_SDK/licenses/android-sdk-preview-license"
    sdkmanager "platform-tools" "platforms;android-27"

```

But this ain’t working either, anyone has any idea how to solve this?

---

<div class="post-metadata">

**Author:** ![Andoctorey](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/andoctorey/32/813_2.png) [@Andoctorey](https://discuss.circleci.com/u/Andoctorey)\
**Post date:** [January 16, 2018, 2:12pm UTC](https://discuss.circleci.com/t/circleci-android-accept-licenses/19369/2 "2018-01-16T14:12:52Z")

</div>

Same for me with version 1

---

<div class="post-metadata">

**Author:** ![brandonschabell](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/brandonschabell/32/10215_2.png) [@brandonschabell](https://discuss.circleci.com/u/brandonschabell)\
**Post date:** [January 17, 2018, 6:36am UTC](https://discuss.circleci.com/t/circleci-android-accept-licenses/19369/3 "2018-01-17T06:36:45Z")

</div>

I didn’t need to do this on Circle, but I did on Travis CI… I had a very similar setup to what you pasted, except try changing “$ANDROID\_SDK” to “$ANDROID\_HOME”. On Circle, I just needed to make sure I accepted the license agreement locally before pushing.

---

<div class="post-metadata">

**Author:** ![DanielMartinus](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/danielmartinus/32/10460_2.png) [@DanielMartinus](https://discuss.circleci.com/u/DanielMartinus)\
**Post date:** [January 18, 2018, 7:06pm UTC](https://discuss.circleci.com/t/circleci-android-accept-licenses/19369/4 "2018-01-18T19:06:16Z")

</div>

So you shouldn’t need it indeed. But it’s not working with or without. There’s going something wrong, with all my projects whilst having the same configuration as other projects. I’m really out of options.

Btw, replacing ANDROID\_SDK to ANDROID\_HOME didn’t work.

---

<div class="post-metadata">

**Author:** ![DanielMartinus](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/danielmartinus/32/10460_2.png) [@DanielMartinus](https://discuss.circleci.com/u/DanielMartinus)\
**Post date:** [January 20, 2018, 2:25pm UTC](https://discuss.circleci.com/t/circleci-android-accept-licenses/19369/5 "2018-01-20T14:25:52Z")

</div>

I’ve been able to fix it. It had nothing to do with the licenses stuff, this isn’t necessary anymore since the docker image already takes care of this now.

My problem was that my config file was named: `config.yaml` while it should have been `config.yml`. Oops.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/circleci/original/3X/5/1/511608acda8e85906e15909b57bd0a46c1dbe291.png) [@system](https://discuss.circleci.com/u/system)\
**Post date:** [June 18, 2018, 11:33am UTC](https://discuss.circleci.com/t/circleci-android-accept-licenses/19369/6 "2018-06-18T11:33:46Z")

</div>


