【问题标题】:ionic build Android | CordovaError: Requirements check failed for JDK 1.8.x! Detected version: 512.0.0离子构建Android | CordovaError:JDK 1.8.x 的要求检查失败!检测到的版本:512.0.0
【发布时间】:2021-09-05 11:52:42
【问题描述】:
    CordovaError: Requirements check failed for JDK 1.8.x! Detected version: 512.0.0
Check your ANDROID_SDK_ROOT / JAVA_HOME / PATH environment variables.
    at Object.module.exports.check_java (E:\QSET\user_app\platforms\android\cordova\lib\check_reqs.js:145:15)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async Promise.all (index 0)
[ERROR] An error occurred while running subprocess cordova.

        cordova.cmd build android --verbose exited with exit code 1.

        Re-running this command with the --verbose flag may provide more information.
  ionic:utils-process onBeforeExit handler: 'process.exit' received +0ms
  ionic:utils-process onBeforeExit handler: running 2 functions +1ms
  ionic:utils-process error while killing process tree for 8768: Error: Command failed: taskkill /pid 8768 /T /F
  ionic:utils-process ERROR: The process "8768" not found.
  ionic:utils-process 
  ionic:utils-process     at ChildProcess.exithandler (child_process.js:303:12)
  ionic:utils-process     at ChildProcess.emit (events.js:315:20)
  ionic:utils-process     at maybeClose (internal/child_process.js:1021:16)
  ionic:utils-process     at Socket.<anonymous> (internal/child_process.js:443:11)
  ionic:utils-process     at Socket.emit (events.js:315:20)
  ionic:utils-process     at Pipe.<anonymous> (net.js:674:12) {
  ionic:utils-process   killed: false,
  ionic:utils-process   code: 128,
  ionic:utils-process   signal: null,
  ionic:utils-process   cmd: 'taskkill /pid 8768 /T /F'
  ionic:utils-process } +2s
  ionic:utils-process onBeforeExit handler: error from function: Error: Command failed: taskkill /pid 8768 /T /F
  ionic:utils-process ERROR: The process "8768" not found.

当我运行 ionic build android 时出现上述错误

我已尝试更新我的 Gradle + SDK Java Home 变量已正确设置为 JDK 路径,但我不知道为什么会出现此问题。请问有什么建议吗?

【问题讨论】:

    标签: android cordova ionic-framework sdk ionic-native


    【解决方案1】:

    我也遇到了同样的问题,我按照链接中的说明解决了:https://cordova.apache.org/announcements/2020/06/29/cordova-android-9.0.0.html

    (我使用cordova android 10)

    然后删除并再次添加android平台

    【讨论】:

    • 虽然此链接可能会回答问题,但最好在此处包含答案的基本部分并提供链接以供参考。如果链接页面发生更改,仅链接答案可能会失效。 - From Review
    猜你喜欢
    • 2021-08-17
    • 2019-10-07
    • 2020-05-04
    • 2021-04-17
    • 2019-10-31
    • 2022-01-13
    • 1970-01-01
    • 2019-12-06
    • 1970-01-01
    相关资源
    最近更新 更多