Failed to install the following Android SDK packages as some licences have not been accepted.
运行环境:
Android Studio 2021.1
Apple M1 arm64
MacOS Menterey
报错信息:
Failed to install the following Android SDK packages as some licences have not been accepted.
build-tools;30.0.3 Android SDK Build-Tools 30.0.3
To build this project, accept the SDK license agreements and install the missing components using the Android Studio SDK Manager.
Alternatively, to transfer the license agreements from one workstation to another, see http://d.android.com/r/studio-ui/export-licenses.html
Using Android SDK: /Users/lyx/Library/Android/sdk
遇到问题马上翻译:
未能装置以下 Android SDK 软件包,因为某些许可证尚未被承受。构建工具;30.0.3 安卓 SDK 构建工具 30.0.3
要构建此我的项目,请承受 SDK 许可协定,并应用 Android Studio SDK 管理器装置短少的组件。或者,要将许可协定从一个工作站转移到另一个工作站,请参阅 http://d.android.com/r/studio-ui/export-licenses.html
应用 Android SDK:/Users/lyx/Library/Android/SDK
解决办法:
新装置的环境 没有承受许可 ,咱们只须要手动承受一下许可就好了。
首先找到错误信息中提醒的门路,把 sdkmanager 拖到终端,而后加上 –licenses 参数(留神参数前有一个空格)
相似这样:
回车之后会提醒许多的条款,全副填 y 即可(为了失常 build,我莫得抉择 …):
最初,提醒“所有的许可都曾经被承受”
在回到 Android Studio,就能够失常编译了