Android应用构建:13:使用sdkmanager自动接受license的方法
发布日期:2021-06-30 20:16:00
浏览次数:3
分类:技术文章
本文共 1822 字,大约阅读时间需要 6 分钟。
使用sdkmanager, 需要手工输入y已确认接受license才能继续之后的安装,这篇文章介绍自动接受license的方式和写法。问题现象
在使用sdkmanager安装sdk时,会又如下需要输入y接受license的过程,而如果希望全程无手工干预,比如此部分写在Dockerfile之中,则无法进行下一步安装,因为需要首先接受license才能继续安装。
[root@liumiaocn bin]# ./sdkmanager platform-tools "platforms;android-29" "build-tools;29.0.2"License android-sdk-license: ] 10% Computing updates... ---------------------------------------Terms and Conditions...省略14.7 The License Agreement, and your relationship with Google under the License Agreement, shall be governed by the laws of the State of California without regard to its conflict of laws provisions. You and Google agree to submit to the exclusive jurisdiction of the courts located within the county of Santa Clara, California to resolve any legal matter arising from the License Agreement. Notwithstanding this, you agree that Google shall still be allowed to apply for injunctive remedies (or an equivalent type of urgent legal relief) in any jurisdiction.January 16, 2019---------------------------------------Accept? (y/N): y[=======================================] 100% Unzipping... platform-tools/systr[root@liumiaocn bin]#
不做处理的Dockerfile的构建结果失败信息可能如下所示
Accept? (y/N): Skipping following packages as the license is not accepted:Android SDK Platform-ToolsAndroid SDK Build-Tools 29.0.2Android SDK Platform 29The following packages can not be installed since their licenses or those of the packages they depend on were not accepted: platforms;android-29 build-tools;29.0.2 platform-tools
对应方法
执行命令:yes | sdkmanager --licenses
执行时会显示如下信息,可自动接受license,不再需要手动输入y。
Accept? (y/N): All SDK package licenses accepted[=======================================] 100% Unzipping... platform-tools/systr
此种对应方式是在如下文章中获取并确认的方法:
- https://discuss.circleci.com/t/android-platform-28-sdk-license-not-accepted/27768
转载地址:https://liumiaocn.blog.csdn.net/article/details/103638793 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!
发表评论
最新留言
能坚持,总会有不一样的收获!
[***.219.124.196]2024年05月01日 05时44分11秒
关于作者
喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
-- 愿君每日到此一游!
推荐文章
JAVA学习笔记4 - 循环与分支结构
2019-04-30
JAVA学习笔记6 - 数组
2019-04-30
JAVA学习笔记8 - Stream 和 File I/O
2019-04-30
JAVA学习笔记9 - 异常
2019-04-30
JAVA学习笔记10 - 继承
2019-04-30
JAVA学习笔记11 - 接口interface
2019-04-30
JAVA学习笔记12 - 包package
2019-04-30
Android 开发学习笔记 00 - Getting Started
2019-04-30
【学习笔记】Android Activity
2019-04-30
【学习笔记】Android Fragments
2019-04-30
Android使用Retrofit_00_Getting Started
2019-04-30
Android使用Retrofit_01_OAuth2 + GitHub
2019-04-30
Django + REST学习笔记
2019-04-30
【转载】将Ubuntu16.04 中gedit在仅显示一个文件时显示文件名tab
2019-04-30
fstream 对象多次使用时注意clear
2019-04-30