首页 > 解决方案 > 离子构建Android | CordovaError:JDK 1.8.x 的要求检查失败!检测到的版本:512.0.0

问题描述

    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 路径,但我不知道为什么会出现此问题。请问有什么建议吗?

标签: androidcordovaionic-frameworksdkionic-native

解决方案


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

(我使用cordova android 10)

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


推荐阅读