ionic2 打包Android时报错Error: cmd: Command failed with exit code 1 Error output: FAILURE: Build failed w

命令行中出现的错误如下:

Error: cmd: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'android'.
> You have not accepted the license agreements of the following SDK components:
[Android SDK Platform 25].
Before building your project, you need to accept the license agreements and complete the installation of the missing components us
ing the Android Studio SDK Manager.
Alternatively, to learn how to transfer the license agreements from one workstation to another, go to http://d.android.com/r/studi
o-ui/export-licenses.html

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

原因:你的SDK中缺少API为25(android 7.1.1)的SDK。

解决方案:打开android SDK manager进行找到代号为25的SDK包进行安装即可。
这里写图片描述

安装完后再次打包即可。

猜你喜欢

转载自blog.csdn.net/li11_/article/details/79193916