4
votes

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
1
The instructions seem fairly straightforward. What problems are you encountering? Do you not have write access to the licenses/ directory on the CI server?CommonsWare
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
Google is highly unlikely to offer this IMHO.CommonsWare
So it's nice that it downloads needed stuff when I build manually but I cannot use it on my CI-server, correct?hardysim
I tried theecho "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

1 Answers

1
votes

$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.