android - cordova 无法生成 apk,说配置项目 ':CordovaLib' 时发生了一些事情

标签 android cordova ionic-framework apk

我是 ionic 的初学者 .. 并且正在尝试从 ionic 项目生成 apk .. 但不幸的是它未能生成。出现此错误

 Android Studio project detected

ANDROID_HOME=C:\Users\abdel ysf\AppData\Local\Android\sdk JAVA_HOME=C:\Program Files\java\jdk1.8.0_151 工作室 子项目路径:CordovaLib 子项目路径:app publishNonDefault 已弃用,不再有效。现在已发布所有变体。 [18:51:59] lint 在 15.14 秒内完成 检查 C:\Users\abdel ysf\AppData\Local\Android\sdk\licenses 中包 Android SDK Platform 26 的许可证 警告:不接受 Android SDK Platform 26 包的许可。

失败:构建失败,出现异常。

  • 出了什么问题: 配置项目“:CordovaLib”时出现问题。

    You have not accepted the license agreements of the following SDK components: [Android SDK Platform 26]. 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

  • 尝试: 使用 --stacktrace 选项运行以获取堆栈跟踪。使用 --info 或 --debug 选项运行以获得更多日志输出。

  • https://help.gradle.org 获得更多帮助

在 7 秒内构建失败 (节点:23120)UnhandledPromiseRejectionWarning:错误:cmd:命令失败,退出代码为 1 错误输出: 失败:构建失败,出现异常。

  • 出了什么问题: 配置项目“:CordovaLib”时出现问题。

    You have not accepted the license agreements of the following SDK components: [Android SDK Platform 26]. 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

  • 尝试: 使用 --stacktrace 选项运行以获取堆栈跟踪。使用 --info 或 --debug 选项运行以获得更多日志输出。

  • https://help.gradle.org 获得更多帮助

在 7 秒内构建失败 在 ChildProcess.whenDone(C:\Users\abdel ysf\Desktop\ionic\HelloWorld\platforms\android\cordova\node_modules\cordova-common\src\superspawn.js:169:23) 在 emitTwo (events.js:126:13) 在 ChildProcess.emit(events.js:214:7) 在 maybeClose (internal/child_process.js:925:16) 在 Process.ChildProcess._handle.onexit(内部/child_process.js:209:5) (节点:23120)UnhandledPromiseRejectionWarning:未处理的 promise 拒绝。这个错误要么是在没有 catch block 的情况下在异步函数内部抛出,要么是因为拒绝了一个没有用 .catch() 处理的 promise 。 (拒绝编号:1) (节点:23120)[DEP0018] DeprecationWarning:未处理的 promise 拒绝已弃用。将来,未处理的 promise 拒绝将以非零退出代码终止 Node.js 进程。

我使用的命令是: ionic Cordova 构建安卓

最佳答案

打开 Android Studio SDK 管理器并在“SDK 平台”选项卡下,选择所需的 Android 版本(例如:Android 8.1(Oreo))并单击确定。如果错误不断重复,请尝试安装一些以前的 Android 版本。

关于android - cordova 无法生成 apk,说配置项目 ':CordovaLib' 时发生了一些事情,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49884979/

相关文章:

android - 如何在 android 中应用所有 instagram 照片效果

android - facebook auth dialog return The page you requested was not found 而不是重定向回我的 Activity ?

android - 尝试将 fragment 覆盖在现有布局上

android - 在使用 Cordova 开发的 Android 应用程序中自定义概览栏颜色

cordova - 基于发布的代码推送的强制或可选更新

java - 在 Android 12 上使用 Huawei HMS Base 6.1.0.302 执行针对 API 31 的 Android APP 时崩溃

javascript - 如何在没有ajax的情况下调用上一页

javascript - ionic 应用浏览器 : Custom Events

javascript - 使用 angular JS 和 ionic 从 select 中获取选定的选项

ionic-framework - 防止键盘在 Ionic 4 中调整 iOS/Android 上的 View 大小