android: automatically accept license for gradle's SDK auto-download

标签 android gradle download sdk licensing

有这个线程(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/

相关文章:

android - 默认 Android Studio 抽屉导航 Activity 模板不显示汉堡包图标,仅显示箭头图标

java - 平板电脑和手机之间的应用程序小部件大小不一致

android - 如何将命令行参数从 gradlew.bat 传递到 Android/NDK 上的 Clang

Android:通过 http 加载多个位图/缩略图的最快方法是什么?

javascript - 我可以将带有 GIF 内容的 $.post 函数的结果放入 javascript Image 对象吗?

android - 所有 com.android.support 库必须使用完全相同的版本规范

安卓工作室 : UnsupportedOperationException: Operation is not supported > for read-only collection

android - 自动增量VersionCode Gradle任务未按预期执行

gradle - 使用gradle-git-properties插件在Kotlin DSL中进行GString惰性评估

ruby - 如何通过 HTTP 下载二进制文件?