4

There's this thread (Automatically accept all SDK licences) and the now-deprecated lib (https://github.com/JakeWharton/sdk-manager-plugin) which addresses the problem of updating the (CI server) system which address this problem but they should not be needed anymore...


In the current version of the android-tools (I think since v2.2.0) gradle will auto-download the needed SDK, build-tools etc. (which would be great).

In my case, gradle seems to download a new build-tools-version for me (as I changed the dependency in the code) but it stops because I didn't accept the licence.

* 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 24.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

~ Question is, what do I need to do to make this work?


PS: This is my call on the CI server:

./gradlew clean assembleDebug
Community
  • 1
  • 1
hardysim
  • 2,756
  • 2
  • 25
  • 52
  • [The instructions](http://d.android.com/r/studio-ui/export-licenses.html) seem fairly straightforward. What problems are you encountering? Do you not have write access to the `licenses/` directory on the CI server? – CommonsWare Sep 21 '16 at 12:42
  • When I got it right, the license might change every update so it will stop again. I'm looking for some kind of parameter to "gradlew" like "auto-accept licence when auto-downloading SDK". – hardysim Sep 21 '16 at 20:37
  • Google is highly unlikely to offer this IMHO. – CommonsWare Sep 21 '16 at 20:58
  • So it's nice that it downloads needed stuff when I build manually but I cannot use it on my CI-server, correct? – hardysim Sep 23 '16 at 06:53
  • @hardysim you could install the build tools and platform with tools/android utility and echo "yes" to all answers for CI automation. – nurettin Oct 05 '16 at 10:16
  • @nurettin can you give an example? I know about installing the tools by using the number from `android list sdk --all` but these numbers change every time. – hardysim Oct 06 '16 at 11:13
  • @hardysim there is a related question here `http://stackoverflow.com/questions/4681697/is-there-a-way-to-automate-the-android-sdk-installation` in which they give an example: `android update sdk -u --filter platform-tools,android-16,extra-android-support` to explicitly state filters instead of entering numbers. Not sure how exactly you would install the exact version of build tools you'd need for the project, though. (try giving dash version number) At this point simply copying licenses from a master seems more sensible than trying to get it installed from commandline. – nurettin Oct 06 '16 at 11:24
  • 1
    I tried the`echo "y"` thing but it's not working. It gives me a `Unknown response ''`. In the other question there was a comment telling that there'll be a flag `--accept-license` but it seems that it's still not available. So no progress here without coping a license manually (btw: where's that `license`-folder located on ubuntu)? – hardysim Oct 07 '16 at 07:19
  • @hardysim `--accept-license` is not a valid flag in any version of SDK Update Manager. – IgorGanapolsky Nov 29 '16 at 15:00

1 Answers1

1

$ANDROID_HOME/licenses is the location of the licenses folder.

See https://stackoverflow.com/a/38381577/901597 for commands to configure this folder on your CI machines.

Community
  • 1
  • 1
Joe Bowbeer
  • 3,574
  • 3
  • 36
  • 47
  • That folder does not exist. It only gets created with the UI version of SDK Update Manager. If one tries to install sdk components from the command line, that folder never gets created. – IgorGanapolsky Nov 29 '16 at 14:59