简体   繁体   English

Cordova CLI - 不更新 config.xml

[英]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.在过去的 1-2 年里,我一直在使用 Cordova CLI 6.5.0,它运行正常。 We are upgrading our main app to android@8.0.0 , which required a Cordova CLI upgrade.我们正在将我们的主应用程序升级到android@8.0.0 ,这需要 Cordova CLI 升级。 In using Cordova CLI 9.0.0, I'm noticing that many things are no longer updating the config.xml file:在使用 Cordova CLI 9.0.0 时,我注意到很多东西不再更新 config.xml 文件:

  • platform adds - no longer see <engine> elements平台添加 - 不再看到<engine>元素
  • plugin adds - not adding <plugin> elements插件添加 - 不添加<plugin>元素

I am making sure --save is used in the commands (which I gather is not even required anymore).我确保--save在命令中使用(我收集到的甚至不再需要)。 When I run a cordova platform list or cordova plugin list I see the expected platforms/plugins.当我运行cordova platform listcordova plugin list时,我看到了预期的平台/插件。 I also see that the package.json is used more heavily now.我还看到 package.json 现在使用得更多了。 However, the plugin/platform versions are not in the package.json so I can't imagine that's a complete replacement?但是,插件/平台版本不在 package.json 中,所以我无法想象这是一个完整的替代品?

Lastly, some additional things I've tried:最后,我尝试了一些其他的事情:

  • running cordova platform android save运行cordova platform android save
  • running cordova clean and cordova prepare运行cordova cleancordova 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?这些较新的 cordova 版本现在不经常利用 config.xml 吗?

Looks like this was an expected change with Cordova 9.0.0.看起来这是 Cordova 9.0.0 的预期变化。 I can see hints of the reason in the Cordova 9.0 Lib release .我可以在Cordova 9.0 Lib 版本中看到原因的提示。 Specifically this change that got pulled in. There are also hints of the new package.json format here .特别是这个被引入的变化这里也有新的 package.json 格式的提示。

The config.xml file was extremely important to Cordova setup for years.多年来,config.xml 文件对 Cordova 设置极为重要。 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.也许我只是在错误的地方寻找。

Cordova 9.0.0科尔多瓦 9.0.0

cordova plugin add cordova-plugin-device
cordova plugin save

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM