简体   繁体   English

ionic cordova [ERROR] 运行子进程时发生错误

[英]ionic cordova [ERROR] An error occurred while running subprocess

I am using the command ionic cordova build and I get the following errors and I don't find a clear answer on this.我正在使用命令ionic cordova build ,我收到以下错误,我没有找到明确的答案。 With this error I can not pass the application to android studio出现此错误,我无法将应用程序传递给 android 工作室

cordova-plugin-androidx-adapter: Processed 14 source files in 635ms Checking Java JDK and Android SDK versions ANDROID_SDK_ROOT=C:\Users\andres\AppData\Local\Android\sdk (recommended setting) ANDROID_HOME=C:\Users\andres\AppData\Local\Android\Sdk (DEPRECATED) Using Android SDK: C:\Users\andres\AppData\Local\Android\sdk cordova-plugin-androidx-adapter: Processed 14 source files in 635ms Checking Java JDK and Android SDK versions ANDROID_SDK_ROOT=C:\Users\andres\AppData\Local\Android\sdk (recommended setting) ANDROID_HOME=C:\Users\andres\ AppData\Local\Android\Sdk(已弃用)使用 Android SDK:C:\Users\andres\AppData\Local\Android

FAILURE: Build failed with an exception. FAILURE:构建失败并出现异常。

  • What went wrong: The supplied javaHome seems to be invalid.出了什么问题:提供的 javaHome 似乎无效。 I cannot find the java executable.我找不到 java 可执行文件。 Tried location: C:\Program Files\Java\jdk-17.0.4\bin\java.exe尝试位置:C:\Program Files\Java\jdk-17.0.4\bin\java.exe

  • Try:尝试:

Run with --stacktrace option to get the stack trace.使用 --stacktrace 选项运行以获取堆栈跟踪。 Run with --info or --debug option to get more log output.使用 --info 或 --debug 选项运行以获得更多日志 output。 Run with --scan to get full insights.运行 --scan 以获得完整的见解。

  • Get more help at https://help.gradle.org Command failed with exit code 1: C:\Program Files\gradle-7.5\bin\gradle.BAT -p C:\Users\andres\Desktop\aplicacion\platforms\android wrapper -b C:\Users\andres\Desktop\aplicacion\platforms\android\wrapper.gradle [ERROR] An error occurred while running subprocess cordova. Get more help at https://help.gradle.org Command failed with exit code 1: C:\Program Files\gradle-7.5\bin\gradle.BAT -p C:\Users\andres\Desktop\aplicacion\platforms\ android wrapper -b C:\Users\andres\Desktop\aplicacion\platforms\android\wrapper.gradle [错误] 运行子进程 ZC0E0D6E58B4693D79A7EDEEB8 时出错。

     cordova.cmd build android exited with exit code 1. Re-running this command with the --verbose flag may provide more information.

enter image description here在此处输入图像描述

The issue might be with you java version according to the question description.根据问题描述,问题可能与您的 java 版本有关。

C:\Program Files\Java\jdk-17.0.4\bin\java.exe C:\Program Files\Java\jdk-17.0.4\bin\java.exe

Java 11 is supported for cordova 10+ which allows for the same minimum Android versions as cordova 9. This should now be the preferred solution. Java 11 is supported for cordova 10+ which allows for the same minimum Android versions as cordova 9. This should now be the preferred solution.

So you need to check your ionic, cordova and java version and set it accordingly.因此,您需要检查您的 ionic、cordova 和 java 版本并进行相应设置。

I hope this helps.我希望这有帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM