有这个线程(Automatically accept all SDK licences)和现已弃用的库(https://github.com/JakeWharton/sdk-manager-plugin)解决了更新(CI 服务器)系统的问题,解决了这个问题,但不再需要它们了......
在当前版本的 android-tools 中(我认为自 v2.2.0 起)gradle 将自动下载所需的 SDK、构建工具等(这会很棒)。
就我而言,gradle 似乎为我下载了一个新的构建工具版本(因为我更改了代码中的依赖项)但它停止了,因为我不接受许可证。
* 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
~ 问题是,我需要做什么才能完成这项工作?
PS:这是我在 CI 服务器上的调用:
./gradlew clean assembleDebug
最佳答案
$ANDROID_HOME/licenses
是许可证文件夹的位置。
参见 https://stackoverflow.com/a/38381577/901597用于在您的 CI 机器上配置此文件夹的命令。
关于android: automatically accept license for gradle's SDK auto-download,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39616419/