Comments (2)
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.
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)
- Android: custom-preference isn't doing anything, no error given HOT 1
- not compatible with cordova 9
- iOS location issue on uploading the apptore - ask for NSLocationAlwaysUsageDescription HOT 2
- All of a sudden (after updating node/npm LTS and cordova to 8.1.2), upon 'cordova run android', "Error loading dependencies (Cannot find module 'tostr') - attempting to resolve" - must install all deps by hand now HOT 6
- cordova-custom-config: Error updating config for platform 'android': Cannot use absolute path on element HOT 2
- Cordova builds fail with XCode-beta 11 HOT 4
- i need help with error unboun prefix HOT 1
- Question: iOS - how to set Legacy Build System ? HOT 5
- Builds fail when attempting usesClearText=true HOT 1
- Cordova ios build error - can someone help HOT 1
- Question: is this plugin needed for UISupportedInterfaceOrientations? HOT 2
- support capacitor HOT 1
- [Bug][Android] '"{{proj_path}}\platforms\android\cordova\version"' is not recognized as an internal or external command, operable program or batch file. HOT 1
- Cannot insert new Item to the section on AndroidManifest
- Vulnerability with package 'colors' HOT 1
- vulnerability in xcode package HOT 1
- Config.xml Bug HOT 6
- Ionic - The prefix "tools" for attribute "tools:node" associated with an element type "uses-permission" is not bound. HOT 1
- cordova-ios renamed Images.xcassets as Assets.xcassets meaning that asset_catalog needs to be updated
- BSF Cordova Ecosystem Crowdfunding Plan
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cordova-custom-config.