cordova-common icon indicating copy to clipboard operation
cordova-common copied to clipboard

Not possible to disable backup, because of config conflicts are handled

Open sithwarrior opened this issue 5 years ago • 1 comments

Bug Report

I would like to set the following setting in my config.xml , to disable backups as it can result in major problems with state. However, that's not possible if you have plugins that also alter AndroidManifest.xml application, ie requestLegacyExternalStorage as has also been introduced in the master branch of cordova-file.

Config.xml

<edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application" xmlns:android="http://schemas.android.com/apk/res/android">
  <application android:allowBackup="false"/>
</edit-config>

plugin.xml

<edit-config file="AndroidManifest.xml" mode="merge" target="/manifest/application">
  <application android:requestLegacyExternalStorage="true" />
</edit-config>
Failed to install 'cordova-plugin-file': Error: cordova-plugin-file cannot be added. <edit-config> changes in this plugin conflicts with <edit-config> changes in config.xml. Conflicts must be resolved before plugin can be added.

Problem

I can't disable android backup, and use plugins like cordova-file from master branch, or telerik-image-picker because they have the same "target", not because they actually conflict. This is also a problem because many others target the same xml element, because it hosts a lot of application settings as per the Android Documentation: https://developer.android.com/guide/topics/manifest/application-element

What is expected to happen?

Android backup is disabled, plugins are useable

What does actually happen?

Conflict checker cancels plugin install on Android platform.

Information

Command or Code

with the following added to config.xml

<edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application" xmlns:android="http://schemas.android.com/apk/res/android">
  <application android:allowBackup="false"/>
</edit-config>

Cordova Plugin add cordova-plugin-telerik-imagepicker@latest

or cordova plugin add https://github.com/apache/cordova-plugin-file/

Environment, Platform, Device

Cordova-Android 9.0

Version information

Cordova CLI 10.0.0 Cordova Android 9.0.0 Cordova Plugin Telerik ImagePicker 2.3.5 Cordova Plugin File@Master

Checklist

  • [x] I searched for existing GitHub issues
  • [x] I updated all Cordova tooling to most recent version
  • [x] I included all the necessary information above

sithwarrior avatar Nov 04 '20 09:11 sithwarrior

This appears to be a problem with the file merging code, which lives in cordova-common so I'll move this issue over to that repo.

breautek avatar Nov 04 '20 13:11 breautek