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

Plugins conflict when there is no actual conflict #1423

Open
3 tasks done
AhmedAyachi opened this issue Apr 21, 2022 · 2 comments
Open
3 tasks done

Plugins conflict when there is no actual conflict #1423

AhmedAyachi opened this issue Apr 21, 2022 · 2 comments
Labels

Comments

@AhmedAyachi
Copy link

AhmedAyachi commented Apr 21, 2022

Bug Report

Plugins conflict when there is no actual conflict:

i created two plugins A and B
A: has a config-file tag that adds two activity tags to the application tag.
B: an edit-config that adds attributes to the application tag.

when i add B and then A no issue
when i add A and then B (i need this because i've created a cordova app starter that has the A plugin by default),
it says there's a conflict that actually doesn't exist but no problem i tried to force the command
the first activity tag added by the A Plugin is being removed which crushes the A plugin

What is expected to happen?

the B plugin should be added with no probs at all;
no need to force at all because there is no actual conflict.
or fix the conflict detection algo.
thank you

Version information

Cordova-android: 10.1.2
cordova-cli: 11.0.0
windows 10

Checklist

  • I searched for existing GitHub issues
  • I updated all Cordova tooling to most recent version
  • I included all the necessary information above
    Screenshot 2022-04-21 234020
    Screenshot 2022-04-21 234114
@GitToTheHub
Copy link

Hi, I have the same Problem, but with a Cordova app and a plugin.
I'm using cordova-plugin-googlemaps which add some values to AndroidManifest.xml with config-file:

    <config-file target="AndroidManifest.xml" parent="/manifest/application">
      <meta-data android:name="com.google.android.geo.API_KEY" android:value="${GOOGLE_MAPS_ANDROID_API_KEY}"/>
      <!-- Google Play Services SDK -->
      <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version"/>
      <!-- for Android 9 or above -->
      <uses-library android:name="org.apache.http.legacy" android:required="false"/>
    </config-file>

(Sources can be found here: https://github.com/mapsplugin/cordova-plugin-googlemaps/blob/2cdc896cb5edfadb02aed9995ea742567dc8de02/plugin.xml#L251)

In my config.xml I want to change something on /manifest/application:

    <edit-config file="AndroidManifest.xml"
                 target="/manifest/application"
                 mode="merge">
      <application android:allowBackup="false"/>
    </edit-config>

When I build android, it says in the log:

Conflict found, edit-config changes from config.xml will overwrite plugin.xml changes

But there should not be a conflict.

Finally android:allowBackup="false" was added and the changes from cordova-plugin-googlemaps were partially added. Only the first line was not added:

<meta-data android:name="com.google.android.geo.API_KEY" android:value="${GOOGLE_MAPS_ANDROID_API_KEY}"/>

My app crashed, because there is no API-Key present for Google Maps.

@GitToTheHub
Copy link

Related Issues:
#1280
#1126

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants