Failed to install the following Android SDK packages as some licences have not been accepted.
运行环境:
Android Studio 2021.1Apple M1 arm64MacOS 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.3To 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.htmlUsing 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,就能够失常编译了