Storing Versions

Usually npm based packages, as Apache Cordova uses to distribute its components, store the version in a version field of the package.json file. For various reasons, some of Cordova's packages also store the version string in other locations:



  • VERSION file in the root of the repository or native library. When a platform is installed, package.json is not copied over, so VERSION is used to find out what version of a platform is actually installed
  • bin/templates/scripts/cordova/version (or equivalent script per platform) has another copy
  • Platform specific:
    • Android
      • build.gradle has version or similar
      • .java file that has a CORDOVA_VERSION
    • iOS
      • CDVAvailability.h has two #define lines that list the version


  • plugin.xml, version attribute of plugin tag
  • Plugins contains a tests “plugin” that has its own package.json and plugin.xml that has a synchronized version string as the main plugin