diff --git a/bin/templates/cordova/lib/Adb.js b/bin/templates/cordova/lib/Adb.js index ec3f3152..e28c4d96 100644 --- a/bin/templates/cordova/lib/Adb.js +++ b/bin/templates/cordova/lib/Adb.js @@ -67,6 +67,9 @@ Adb.install = function (target, packagePath, opts) { if (output.match(/INSTALL_PARSE_FAILED_NO_CERTIFICATES/)) { output += '\n\n' + 'Sign the build using \'-- --keystore\' or \'--buildConfig\'' + ' or sign and deploy the unsigned apk manually using Android tools.'; + } else if (output.match(/INSTALL_FAILED_VERSION_DOWNGRADE/)) { + output += '\n\n' + 'You\'re trying to install apk with a lower versionCode that is already installed.' + + '\nEither uninstall an app or increment the versionCode.'; } return Q.reject(new CordovaError('Failed to install apk to device: ' + output)); diff --git a/bin/templates/cordova/lib/emulator.js b/bin/templates/cordova/lib/emulator.js index 28c93f54..0b0c39ac 100644 --- a/bin/templates/cordova/lib/emulator.js +++ b/bin/templates/cordova/lib/emulator.js @@ -372,8 +372,11 @@ module.exports.install = function(givenTarget, buildResults) { if (stdout.match(/INSTALL_PARSE_FAILED_NO_CERTIFICATES/)) { stdout += 'Sign the build using \'-- --keystore\' or \'--buildConfig\'' + ' or sign and deploy the unsigned apk manually using Android tools.'; + } else if (stdout.match(/INSTALL_FAILED_VERSION_DOWNGRADE/)) { + stdout += 'You\'re trying to install apk with a lower versionCode that is already installed.' + + '\nEither uninstall an app or increment the versionCode.'; } - + reject(new CordovaError('Failed to install apk to emulator: ' + stdout)); } else resolve(stdout); });