Coder Social home page Coder Social logo

Comments (2)

dpa99c avatar dpa99c commented on August 15, 2024

Short answer - add this to your config.xml:

<preference name="cordova-custom-config-autorestore" value="false" />

Long answer: this is being caused as a side effect of the backup behaviour which is turned on by default in the plugin (I may have to reconsider this). The plugin attempts to make custom config settings "removable" by taking a backup of the platform config files before the first prepare operation after the plugin is installed. In theory this should restore the original platform config file, allowing this plugin and cordova to modify it to produce an up-to-date version. Without this behaviour, if a custom config setting defined in the config.xml is applied to a platform config file, then removed from the config.xml, there's no (easy) way to remove the corresponding config setting from the platform config file. The backup script is invoked as a before_prepare hook, but it seems that cordova updates the version numbers in the platform config files even before the before_plugin hook scripts are executed, hence any updates made by cordova to version numbers are being overwritten when the backup platform config file is restored. Unfortunately there's not a before_before_prepare hook to restore the backups before cordova updates the version numbers, so for now the simple solution, as I've said above, is to turn off the auto-restore of backup files. Of course, this will have the side effect that any custom config values you remove from your config.xml will not be removed from the corresponding platform files, so you'll need to do this manually.

from cordova-custom-config.

bostondv avatar bostondv commented on August 15, 2024

Awesome, that did the trick.

For my case I'm totally satisfied without the backup behaviour and I think
it may make sense to default it to off. Although it's handy, it's easy
enough to remove manually a value one time from the platform file.

Thanks!

On Tue, Feb 2, 2016 at 4:30 PM Dave Alden [email protected] wrote:

Short answer - add this to your config.xml:

Long answer: this is being caused as a side effect of the backup behaviour
https://github.com/dpa99c/cordova-custom-config#backups which is turned
on by default in the plugin (I may have to reconsider this). The plugin
attempts to make custom config settings "removable" by taking a backup of
the platform config files before the first prepare operation after the
plugin is installed. In theory this should restore the original platform
config file, allowing this plugin and cordova to modify it to produce an
up-to-date version. Without this behaviour, if a custom config setting
defined in the config.xml is applied to a platform config file, then
removed from the config.xml, there's no (easy) way to remove the
corresponding config setting from the platform config file. The backup
script is invoked as a before_prepare hook
https://github.com/dpa99c/cordova-custom-config/blob/master/plugin.xml#L22,
but it seems that cordova up dates th e version numbers in the platform
config files even before the before_plugin hook scripts are executed,
hence any updates made by cordova to version numbers are being overwritten
when the backup platform config file is restored. Unfortunately there's not
a before_before_prepare hook to restore the backups before cordova
updates the version numbers, so for now the simple solution, as I've said
above, is to turn off the auto-restore of backup files. Of course, this
will have the side effect that any custom config values you remove from
your config.xml will not be removed from the corresponding platform
files, so you'll need to do this manually.


Reply to this email directly or view it on GitHub
#25 (comment)
.

from cordova-custom-config.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.