cordova 无法生成 apk,说配置项目“:CordovaLib”时发生了一些事情
cordova failed to ganarate apk saying there is somthing occurred configuring project ':CordovaLib'
我是 ionic 的初学者..我正在尝试从 ionic 项目生成 apk..但不幸的是它未能成为 generated.giving 这个错误
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 平台 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 选项以获得更多日志输出。
获取更多帮助
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 选项以获得更多日志输出。
获取更多帮助
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 (internal/child_process.js:209:5)
(节点:23120)UnhandledPromiseRejectionWarning:未处理的承诺拒绝。这个错误要么是在没有 catch 块的情况下在异步函数内部抛出,要么是因为拒绝了一个没有用 .catch() 处理的承诺。 (拒绝编号:1)
(节点:23120)[DEP0018] DeprecationWarning:未处理的承诺拒绝已弃用。将来,未处理的承诺拒绝将以非零退出代码终止 Node.js 进程。
我使用的命令是:
离子科尔多瓦构建 android
打开Android工作室,打开AndroidSDK管理器。接受 SDK 许可。
打开 Android Studio SDK 管理器并在 'SDK platforms' 选项卡下,select 所需的 Android 版本(例如:Android 8.1(Oreo))和单击确定。如果错误不断重复,请尝试安装一些以前的 Android 版本。
找到自己本地的android-sdk,如果下载了ndk的相关sdk,会有一个文件夹叫"ndk-bundle"
enter image description here
里面有个叫"toolchains"的文件夹。
enter image description here
我们注意到里面没有mips64el相关的文件。
enter image description here
解决方法如下:
点击here通过浏览器单独下载NDK包。
解压后,打开"toolchains"文件夹,与android-sdk->ndk-bundle->toolchains文件夹对比,找到丢失的文件夹,复制过去
3.重新编译,问题解决。
希望对你有帮助
我是 ionic 的初学者..我正在尝试从 ionic 项目生成 apk..但不幸的是它未能成为 generated.giving 这个错误
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 平台 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 选项以获得更多日志输出。
- 获取更多帮助
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 选项以获得更多日志输出。
- 获取更多帮助
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 (internal/child_process.js:209:5) (节点:23120)UnhandledPromiseRejectionWarning:未处理的承诺拒绝。这个错误要么是在没有 catch 块的情况下在异步函数内部抛出,要么是因为拒绝了一个没有用 .catch() 处理的承诺。 (拒绝编号:1) (节点:23120)[DEP0018] DeprecationWarning:未处理的承诺拒绝已弃用。将来,未处理的承诺拒绝将以非零退出代码终止 Node.js 进程。
我使用的命令是: 离子科尔多瓦构建 android
打开Android工作室,打开AndroidSDK管理器。接受 SDK 许可。
打开 Android Studio SDK 管理器并在 'SDK platforms' 选项卡下,select 所需的 Android 版本(例如:Android 8.1(Oreo))和单击确定。如果错误不断重复,请尝试安装一些以前的 Android 版本。
找到自己本地的android-sdk,如果下载了ndk的相关sdk,会有一个文件夹叫"ndk-bundle"
enter image description here
里面有个叫"toolchains"的文件夹。
enter image description here
我们注意到里面没有mips64el相关的文件。
enter image description here
解决方法如下:
点击here通过浏览器单独下载NDK包。 解压后,打开"toolchains"文件夹,与android-sdk->ndk-bundle->toolchains文件夹对比,找到丢失的文件夹,复制过去 3.重新编译,问题解决。 希望对你有帮助