From 54df4a116c635b76273d6862d5657858187e5e5c Mon Sep 17 00:00:00 2001 From: Fabian Te Date: Sun, 27 Jan 2019 16:52:22 +0100 Subject: [PATCH] Add missing log to Java version check (#624) * Add missing log to Java version check * Simplify version check output Resolves #623 --- bin/templates/cordova/lib/check_reqs.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/bin/templates/cordova/lib/check_reqs.js b/bin/templates/cordova/lib/check_reqs.js index 141042d7..affbefd6 100644 --- a/bin/templates/cordova/lib/check_reqs.js +++ b/bin/templates/cordova/lib/check_reqs.js @@ -355,15 +355,18 @@ module.exports.check_android_target = function (originalError) { // Returns a promise. module.exports.run = function () { return Q.all([this.check_java(), this.check_android()]).then(function (values) { + console.log('Checking Java JDK and Android SDK versions'); console.log('ANDROID_HOME=' + process.env['ANDROID_HOME']); - console.log('JAVA_HOME=' + process.env['JAVA_HOME']); if (!String(values[0]).startsWith('1.8.')) { - throw new CordovaError(`Requirements check failed for JDK 8 ('1.8.*')`); + throw new CordovaError( + 'Requirements check failed for JDK 8 (\'1.8.*\')! Detected version: ' + values[0] + '\n' + + 'Check your JAVA_HOME / ANDROID_HOME / PATH environment variables.' + ); } if (!values[1]) { - throw new CordovaError('Requirements check failed for Android SDK'); + throw new CordovaError('Requirements check failed for Android SDK! Android SDK was not detected.'); } }); };