簡體   English   中英

ionic cordova [ERROR] 運行子進程時發生錯誤

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

我正在使用命令ionic cordova build ,我收到以下錯誤,我沒有找到明確的答案。 出現此錯誤,我無法將應用程序傳遞給 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(已棄用)使用 Android SDK:C:\Users\andres\AppData\Local\Android

FAILURE:構建失敗並出現異常。

  • 出了什么問題:提供的 javaHome 似乎無效。 我找不到 java 可執行文件。 嘗試位置:C:\Program Files\Java\jdk-17.0.4\bin\java.exe

  • 嘗試:

使用 --stacktrace 選項運行以獲取堆棧跟蹤。 使用 --info 或 --debug 選項運行以獲得更多日志 output。 運行 --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 [錯誤] 運行子進程 ZC0E0D6E58B4693D79A7EDEEB8 時出錯。

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

在此處輸入圖像描述

根據問題描述,問題可能與您的 java 版本有關。

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.

因此,您需要檢查您的 ionic、cordova 和 java 版本並進行相應設置。

我希望這有幫助。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM