How to check cordova android version of a cordova/phonegap project?

AndroidCordova

Android Problem Overview


I have received a Security Alert from Google this week that tells me to upgrade my android version of cordova app. The email from google is as below -

> This is a notification that your --apps ids--, is built on a version of Apache Cordova that contains security vulnerabilities. This includes a high severity cross-application scripting (XAS) vulnerability. Under certain circumstances, vulnerable apps could be remotely exploited to steal sensitive information, such as user login credentials. > > You should upgrade to Apache Cordova 3.5.1 or higher as soon as possible. For more information about the vulnerabilities, and for guidance on upgrading Apache Cordova, please see http://cordova.apache.org/announcements/2014/08/04/android-351.html. > > Please note, applications with vulnerabilities that expose users to risk of compromise may be considered “dangerous products” and subject to removal from Google Play.

So, I needed to check the current version of my cordova apps. I can upgrade my cordova installation by using npm update -g cordova on windows cmd. The question is how can I check the current platform (android in my case) version of my cordova app?

Android Solutions


Solution 1 - Android

The current platform version of a cordova app can be checked by the following command

cordova platform version android

And can be upgraded using the command

cordova platform update android

You can replace android by any of your platform choice like "ios" or some else.

This only applies to android platform. I have not checked. You can try replacing android in the code segments to try for other platforms.

Solution 2 - Android

Run

cordova -v 

to see the currently running version. Run the npm info command

npm info cordova

for a longer listing that includes the current version along with other available version numbers

Solution 3 - Android

just type cordova platform ls

This will list all the platforms installed along with its version and available for installation plus :)

Solution 4 - Android

Try

> cordova platform version

It will give you the following output

Installed platforms: android 3.5.1, ios 3.5.0
Available platforms: amazon-fireos, blackberry10, browser, firefoxos

Also to know the version of cordodva cli try

cordova -v 

Solution 5 - Android

The file platforms/platforms.json lists all of the platform versions.

Solution 6 - Android

Recent versions of Cordova have the version number in www/cordova.js.

Solution 7 - Android

For getting all the info about the cordova package use this command:

npm info cordova

Solution 8 - Android

After upgrading the Application. I observed different Cordova versions.

  1. Apache Cordova Cli version which is 6.0.0.
  2. Cordova Android version which is 5.1.0.
  3. Cordova IOS version which is 4.1.1.
  4. Docs version is which is 6.0.0, shown on the Cordova Docs website.

Now i am confused, On which version basis, Google Dev Console is giving warning?

Please migrate your app(s) to Apache Cordova v.4.1.1 or higher as soon as possible and increment the version number of the upgraded APK. Beginning May 9, 2016, Google Play will block publishing of any new apps or updates that use pre-4.1.1 versions of Apache Cordova.

The vulnerabilities were addressed in Apache Cordova 4.1.1. If you’re using a 3rd party library that bundles Apache Cordova, you’ll need to upgrade it to a version that bundles Apache Cordova 4.1.1 or later.

And before upgrading. Our Application versions were these.

  1. Apache Cordova Cli version which is 5.4.1.
  2. Cordova Android version which is 4.1.1.
  3. Cordova IOS version which is 3.9.1.
  4. Docs version is which is 5.4.1, shown on the Cordova Docs website.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionImonView Question on Stackoverflow
Solution 1 - AndroidImonView Answer on Stackoverflow
Solution 2 - AndroidfrankView Answer on Stackoverflow
Solution 3 - Androidhusain shahView Answer on Stackoverflow
Solution 4 - AndroidaWebDeveloperView Answer on Stackoverflow
Solution 5 - AndroidAdamView Answer on Stackoverflow
Solution 6 - AndroidRonaldPKView Answer on Stackoverflow
Solution 7 - AndroidLakshay SharmaView Answer on Stackoverflow
Solution 8 - AndroidAtif HussainView Answer on Stackoverflow