Android 服务器编译遇到LicenceNotAcceptedException(许可未被接受)错误

在服务器编译上编译Android项目,编译可能会遇到LicenceNotAcceptedException(许可未被接受),报错如下:

> com.android.builder.sdk.LicenceNotAcceptedException: Failed to install the following Android SDK packages as some licences have not been accepted.
     ndk-bundle NDK
  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](http://d.android.com/r/studio-ui/export-licenses.html)

  Using Android SDK: /Applications/android-sdk

解决方法:

打开终端,进入到Android Sdk中的/tools/bin/ 目录中,运行./sdkmanager --licenses命令,一路yes,如下:

cd $ANDROID_HOME/tools/bin
./sdkmanager --licenses

Android Sdk的具体目录可以从报错的日志中找到,找到Using Android SDK,后面就是你Sdk的具体目录,如下:

Using Android SDK: /Applications/android-sdk

`

你可能感兴趣的:(Android 服务器编译遇到LicenceNotAcceptedException(许可未被接受)错误)