如何修复“无法安装'cordova-plugin-console':错误”

时间:2016-12-11 19:15:56

标签: android angularjs cordova ionic-framework phonegap-plugins

我正在尝试制作apk文件。 我有安装了sdk的android studio和jdk。 但是当我尝试将android包添加到我的离子文件夹时。我收到此错误

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 24].
Before building your project, you need to accept the license agreements and comp
lete the installation of the missing components using the Android Studio SDK Man
ager.
Alternatively, to learn how to transfer the license agreements from one workstat
ion 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.



BUILD FAILED




Total time: 44.28 secs

Failed to install 'cordova-plugin-console':Error: cmd: Command failed with exit
code 1
    at ChildProcess.whenDone (C:\ionic\lcalc\platforms\android\cordova\node_modu
les\cordova-common\src\superspawn.js:169:23)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at maybeClose (internal/child_process.js:877:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
Error: cmd: Command failed with exit code 1

帮助:(

3 个答案:

答案 0 :(得分:1)

CLI打印构建失败的确切原因。请注意以下行:

A problem occurred configuring root project 'android'.
> You have not accepted the license agreements of the following SDK components:
[Android SDK Platform 24].

因此,打开SDK Manager(如果您不是管理员,则可能需要以管理员身份打开)

安装所需的SDK版本。查看附件图片enter image description here

答案 1 :(得分:0)

在您的sdk中安装平台24.

尝试删除插件。

ptb_word_lm.py

答案 2 :(得分:0)

我有同样的问题。通过更新android studio解决。

  1. 点击文件>打开首选项窗口设置(在Mac上,Android Studio>偏好设置)。
  2. 在左侧面板中,点击外观&行为>系统设置>更新。
  3. 确保选中自动检查更新,然后选择"稳定频道"从下拉列表中。
  4. 单击“应用”或“确定”。
  5. 这真的是最简单的方式。

    无论如何,您可以从命令行更新sdk管理器(使用管理员权限):

    cd path/to/your/android-sdk/tools/bin/
    ./sdkmanager.bat --update
    

    这一切,希望这对你有帮助!