ionic打包报错:You have not accepted the license agreements of the following SDK components: [Android S

错误信息:

......

You have been opted out of telemetry. To change this, run: cordova telemetry on.
Android Studio project detected
ANDROID_HOME=C:\Users\lenovo\AppData\Local\Android\sdk
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_171
studio
Subproject Path: CordovaLib
Subproject Path: app
publishNonDefault is deprecated and has no effect anymore. All variants are now published.

Checking the license for package Android SDK Platform 27 in C:\Users\lenovo\AppData\Local\Android\sdk\licenses
Warning: License for package Android SDK Platform 27 not accepted.
FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':CordovaLib'.
> You have not accepted the license agreements of the following SDK components:
  [Android SDK Platform 27].
  Before building your project, you need to accept the license agreements and complete the installation of the missing components using 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/studio-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.

* Get more help at https://help.gradle.org

BUILD FAILED in 2s
cmd: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':CordovaLib'.
> You have not accepted the license agreements of the following SDK components:
  [Android SDK Platform 27].
  Before building your project, you need to accept the license agreements and complete the installation of the missing components using 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/studio-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.

* Get more help at https://help.gradle.org

BUILD FAILED in 2s
[ERROR] An error occurred while running subprocess cordova.

        cordova run android --device exited with exit code 1.

        Re-running this command with the --verbose flag may provide more information.

D:\project\eyeshot\eyeshot\app>

解决办法:

在Android Studio中安装Android SDK Platform 27,如下图所示:

ionic打包报错:You have not accepted the license agreements of the following SDK components: [Android S_第1张图片

你可能感兴趣的:(ionic)