Skip to main content

Updating the Cordova plugins... there are two locations to manage the plugins

  • config.xml
  • package.json

I was finding some Cordova functionality was not coming through... through further investigation the two files above had conflicting data.

 

Review the data

package.json

    "cordova-browser": "6.0.0",
    "cordova-plugin-advanced-http": "3.3.1",
    "cordova-plugin-android-permissions": "^1.1.3",
    "cordova-plugin-device": "2.1.0",
    "cordova-plugin-file": "^7.0.0",
    "cordova-plugin-ionic-keyboard": "^2.2.0",
    "cordova-plugin-ionic-webview": "^5.0.0",
    "cordova-plugin-splashscreen": "6.0.1",
    "cordova-plugin-statusbar": "3.0.0",
    "cordova-plugin-whitelist": "1.3.5",

config.xml

    <plugin name="cordova-plugin-whitelist" spec="1.3.3" />
    <plugin name="cordova-plugin-device" spec="2.0.2" />
    <plugin name="cordova-plugin-splashscreen" spec="5.0.2" />
    <plugin name="cordova-plugin-ionic-webview" spec="^2.0.0" />
    <plugin name="cordova-plugin-ionic-keyboard" spec="^2.0.5" />
    <plugin name="cordova-plugin-advanced-http" spec="2.0.1" />
    <engine name="browser" spec="5.0.4" />
    <plugin name="cordova-plugin-statusbar" spec="2.4.2" />

 

Syncronise data

Next step sync the data between the two files


    <plugin name="cordova-plugin-whitelist" spec="1.3.5" />
    <plugin name="cordova-plugin-device" spec="2.1.0" />
    <plugin name="cordova-plugin-splashscreen" spec="6.0.1" />
    <plugin name="cordova-plugin-ionic-webview" spec="^5.0.0" />
    <plugin name="cordova-plugin-ionic-keyboard" spec="^2.2.0" />
    <plugin name="cordova-plugin-advanced-http" spec="3.3.1" />
    <engine name="browser" spec="6.0.0" />
    <plugin name="cordova-plugin-statusbar" spec="3.0.0" />

 

Test and check

Have the changes above fixed a few of the issues that were coming thorugh?

Related articles

Andrew Fletcher29 Sep 2023
Setting up an ionic app
Recently a client handed me code that runs an app through iOS and Android. &nbsp;No details about whether native or otherwise. &nbsp;Once I had the opportunity to crawl through the code, definitely not native. &nbsp;Typescript, Angular, Cordova... etc.Glancing at the modification dates, the last...
Andrew Fletcher08 Aug 2022
How to update package.json dependencies to the latest version?
This article works through the steps to update&nbsp;dependencies in package.json file to the latest version. Use npm-check-updates or npm outdated to suggest the latest versions. npm-check-updates is a utility that automatically adjusts a package.json with the latest version of all...