【问题标题】:Cordova can't build on androidCordova 无法在 android 上构建
【发布时间】:2018-05-03 12:09:43
【问题描述】:

cordova 不想用 android 构建。

它通过Xcode在ios下编译。

检测到 Android Studio 项目

ANDROID_HOME=/Users/arthurdoreau/Library/Android/sdk
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-10.0.1.jdk/Contents/Home
(node:61518) UnhandledPromiseRejectionWarning: CordovaError: Requirements check failed for JDK 1.8 or greater
    at /Users/arthurdoreau/Documents/Deeky/platforms/android/cordova/lib/check_reqs.js:370:19
    at _fulfilled (/Users/arthurdoreau/Documents/Deeky/platforms/android/cordova/node_modules/q/q.js:854:54)
    at /Users/arthurdoreau/Documents/Deeky/platforms/android/cordova/node_modules/q/q.js:883:30
    at Promise.promise.promiseDispatch (/Users/arthurdoreau/Documents/Deeky/platforms/android/cordova/node_modules/q/q.js:816:13)
    at /Users/arthurdoreau/Documents/Deeky/platforms/android/cordova/node_modules/q/q.js:624:44
    at runSingle (/Users/arthurdoreau/Documents/Deeky/platforms/android/cordova/node_modules/q/q.js:137:13)
    at flush (/Users/arthurdoreau/Documents/Deeky/platforms/android/cordova/node_modules/q/q.js:125:13)
    at process._tickCallback (internal/process/next_tick.js:172:11)
(node:61518) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:61518) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

【问题讨论】:

    标签: android node.js cordova build


    【解决方案1】:

    错误消息是说需要 JDK 1.8 或更高版本。您使用的是哪个 JDK 版本?如果您还没有安装,请从 Java 网站安装,否则您需要在系统路径文件中设置 JDK 的路径。

    如果问题仍然存在,您应该卸载所有以前的 JDK,包括 1.8,然后安装最新的 JDK。尽管从路径变量中删除以前 JDK 版本的路径也应该可以。

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-02-18
    • 2016-02-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多