Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove ./backup/platform/* on platform remove/update #42

Closed
swbradshaw opened this issue Mar 9, 2016 · 4 comments
Closed

Remove ./backup/platform/* on platform remove/update #42

swbradshaw opened this issue Mar 9, 2016 · 4 comments

Comments

@swbradshaw
Copy link

I recently upgraded my Cordova project from Android 4.1.1 to Android 5.1.1.

I performed a "cordova platform remove android" and shortly after, I added back the platform with the new android version.

Upon building the project I noticed my AndroidManfiest.xml was still pointing to the old targetSDK. I couldn't figure out why. As it turns out, this plugin had a backup of the old Android Manifest. I'm not sure how you are maintaining this backup, but it should be removed anytime the platform is removed. (and probably updated as well?)

I did see the preference, cordova-custom-config-autorestore, which I will implement, but I wanted to at least report this.

@dpa99c
Copy link
Owner

dpa99c commented Mar 11, 2016

I'm beginning to think that this auto-backup/restore feature is more hassle than it's worth. It's a feature someone asked for in the very early stages of the plugin, but I think at the very least I will turn it off default (as opposed to current default of on). Then also, as you suggest, wipe any backups between platform removal/updates.

@swbradshaw
Copy link
Author

I would agree - turn it off by default. I personally don't understand what benefit it offers. If it's removed when the platform is updated, what good was that backup for anyway?

I think a backup/restore would be better implemented manually by someone with their own custom hooks. They obviously have some kind of special scenario going on.

@dpa99c
Copy link
Owner

dpa99c commented Mar 11, 2016

The idea of the backup/restore was to allow "removable" custom config. Let's say you add a preference or config block that has an undesirable effect or you no longer want to apply it. But the plugin has already injected the relevant config into the platform-specific files (e.g. AndroidManifest.xml). Without the backup/restore mechanism, the only way to remove it (without removing/re-adding the platform) is to manually edit the platform configs. The conversion of custom config in the config.xml into the platform-specific translation is not always obvious to plugin users, so manual removal can be tricky for them. Of course, one option is to remove/re-add the platform. I myself never manually touch anything under platforms/ - I consider those sub-folders to be volatile. But plenty of people make manual changes to platform configs (particularly on iOS via XCode) so they see removing/re-adding platforms as a major hassle. Anyway, that's the history of it.

But, agreed, it should be switched off by default, which I'll do in the next release.

@swbradshaw
Copy link
Author

Got it. That makes sense.

I use to fall into that bucket of making manual changes, but as things have matured (and with plugins like this), it should no longer be necessary anymore.

Thanks for the quick reply.

@dpa99c dpa99c closed this as completed in 0fc9969 Apr 18, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants