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

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

Open
3 tasks done
sithwarrior opened this issue Nov 4, 2020 · 1 comment
Open
3 tasks done

Comments

@sithwarrior
Copy link

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

  • I searched for existing GitHub issues
  • I updated all Cordova tooling to most recent version
  • I included all the necessary information above
@breautek
Copy link
Contributor

breautek commented Nov 4, 2020

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 breautek transferred this issue from apache/cordova-android Nov 4, 2020
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