Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cordova CLI - not updating config.xml

I have used the Cordova CLI 6.5.0 for the past 1-2 years, and it's acted normally. We are upgrading our main app to [email protected], which required a Cordova CLI upgrade. In using Cordova CLI 9.0.0, I'm noticing that many things are no longer updating the config.xml file:

  • platform adds - no longer see <engine> elements
  • plugin adds - not adding <plugin> elements

I am making sure --save is used in the commands (which I gather is not even required anymore). When I run a cordova platform list or cordova plugin list I see the expected platforms/plugins. I also see that the package.json is used more heavily now. However, the plugin/platform versions are not in the package.json so I can't imagine that's a complete replacement?

Lastly, some additional things I've tried:

  • running cordova platform android save
  • running cordova clean and cordova prepare
  • adding and removing the platform (and ditching the related directories)
  • Running an actual build (which works fine)

Is this "normal"? Do these newer cordova versions not leverage the config.xml as regularly now?

like image 202
BRass Avatar asked Mar 05 '23 03:03

BRass


1 Answers

Looks like this was an expected change with Cordova 9.0.0. I can see hints of the reason in the Cordova 9.0 Lib release. Specifically this change that got pulled in. There are also hints of the new package.json format here.

The config.xml file was extremely important to Cordova setup for years. I would have expected this change to make a bigger splash in the way of documentation/announcements. Maybe I'm just looking in the wrong places.

like image 80
BRass Avatar answered Mar 29 '23 07:03

BRass