报错信息
编译打包报错: Android SDK packages as some licences have not been accepted
报错信息如下
- Failed to install the following Android SDK packages as some licences have not been accepted.
- build-tools;28.0.2 Android SDK Build-Tools 28.0.2
- 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
分析
明显缺少 build-tools;28.0.2 的 licenses
升级 licenses
首先这肯定是 sdk 包里缺少对应 licenses, 命令如下
sdkmanager --update && yes | sdkmanager --licenses
sdkmanager 命令路径在 sdk 安装路径的 tools/bin 下
sdkmanager 官方介绍
总结
首先 sdkmanager 等命令行工具在 sdk 的 tools/bin
使用 sdkmanager 升级命令获取 licenses
来源: http://www.jianshu.com/p/82064be540e8