Android 如何修复“未能安装“cordova插件控制台”:错误

Android 如何修复“未能安装“cordova插件控制台”:错误,android,angularjs,cordova,ionic-framework,phonegap-plugins,Android,Angularjs,Cordova,Ionic Framework,Phonegap Plugins,我正在尝试制作apk文件。 我有安装了sdk和jdk的android studio。 但当我尝试将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

我正在尝试制作apk文件。 我有安装了sdk和jdk的android studio。 但当我尝试将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

帮助:

在sdk中安装platform 24

尝试删除插件

cordova plugin rm cordova-plugin-console

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管理器,如果您不是管理员,则可能需要以管理员身份打开


安装所需的SDK版本。看附件中的图片

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

通过单击Mac上的文件>设置、Android Studio>首选项打开首选项窗口。 在左侧面板中,单击外观和行为>系统设置>更新。 确保选中“自动检查更新”,然后从下拉列表中选择“稳定通道”。 单击应用或确定。 这真是最简单的方法

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

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

就这些,希望这对你有帮助

正如错误所说,您需要首先接受许可证。我建议你在这个问题上寻求具体的帮助。