自动接受所有 SDK 许可 [英] Automatically accept all SDK licences

查看:33
本文介绍了自动接受所有 SDK 许可的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于 gradle android 插件 2.2-alpha4:

Since gradle android plugins 2.2-alpha4:

Gradle 将尝试下载一个项目缺少的 SDK 包取决于

Gradle will attempt to download missing SDK packages that a project depends on

这非常酷,而且被称为 JakeWharton 项目.

Which is amazingly cool and was know to be a JakeWharton project.

但是,要下载 SDK 库,您需要:接受许可协议或 gradle 告诉您:

But, to download the SDK library you need to: accept the license agreements or gradle tells you:

您尚未接受以下SDK的许可协议组件:[Android SDK Build-Tools 24,Android SDK Platform 24].在构建您的项目之前,您需要接受许可协议并完成缺少组件的安装使用 Android Studio SDK 管理器.或者,学习如何将许可协议从一个工作站转移到另一个工作站,转到http://d.android.com/r/studio-ui/export-licenses.html

You have not accepted the license agreements of the following SDK components: [Android SDK Build-Tools 24, Android SDK Platform 24]. 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

这是一个问题,因为我希望在执行 gradle build 时安装所有 sdk 依赖项.

And this is a problem because I would love to install all sdk dependencies while doing a gradle build.

我正在寻找一种自动接受所有许可证的解决方案.也许是一个 gradle 脚本?你有什么想法吗?

I am looking for a solution to automatically accept all licenses. Maybe a gradle script ? Do you have any ideas ?

推荐答案

UPDATE 2021应该是公认的答案,因为它简单且最新

UPDATE 2021 This should be the accepted answer as its easy and upto date

AndroidSDK 终于可以接受许可了.

AndroidSDK can finally accept licenses.

转到Androidsdk oolsin

yes | sdkmanager --licenses

正如@MoOx 在评论中指出的,在 macOS 上,你可以这样做

as pointed out in the comments by @MoOx, on macOS, you can do

<代码>是的 |须藤 ~/Library/Android/sdk/tools/bin/sdkmanager --licenses

正如@pho、@mikebridge 和 @Noitidart 在 Windows 上的评论中指出的那样,您可以这样做

as pointed out in the comments by @pho, @mikebridge and @ Noitidart on Windows, you can do

cmd.exe/C%ANDROID_HOME% oolsinsdkmanager.bat --licenses"

一定要先安装java

这篇关于自动接受所有 SDK 许可的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆