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

can not install it giving error <edit-config> changes in this plugin conflicts with <edit-config> changes in config.xml #133

Open
grvsingh789 opened this issue Nov 24, 2023 · 10 comments

Comments

@grvsingh789
Copy link

No description provided.

@grvsingh789
Copy link
Author

any update ?

@Mr-Anonymous
Copy link

Yes, I have the same issue. I tried removing most of the things from config.xml and not sure what is causing the issue. I keep getting this error message:

Failed to install 'cordova-plugin-mediapicker-dmcsdk': Error: cordova-plugin-mediapicker-dmcsdk 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.
    at PlatformMunger.add_plugin_changes (/Users/me/Sites/mobile/node_modules/cordova-android/node_modules/cordova-common/src/ConfigChanges/ConfigChanges.js:109:19)
    at /Users/me/Sites/mobile/node_modules/cordova-android/node_modules/cordova-common/src/PluginManager.js:120:33

This is my config.xml:

<?xml version='1.0' encoding='utf-8'?>
<widget android-versionCode="30090051" id="com.app.appmobile" ios-CFBundleVersion="3.9.5.1" version="3.9.5" xmlns="http://www.w3.org/ns/widgets" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:cdv="http://cordova.apache.org/ns/1.0">
    <name>app</name>
    <content src="index.html" />
    <access origin="*" />
    <feature name="StatusBar">
        <param name="ios-package" onload="true" value="CDVStatusBar" />
    </feature>
    <preference name="scheme" value="httpsionic" />
    <preference name="hostname" value="App" />
    <preference name="AndroidInsecureFileModeEnabled" value="true" />
    <preference name="ScrollEnabled" value="true" />
    <preference name="StatusBarOverlaysWebView" value="false" />
    <preference name="StatusBarBackgroundColor" value="#007bed" />
    <preference name="StatusBarStyle" value="lightcontent" />
    <preference name="HeaderColor" value="#007bed" />
    <preference name="webviewbounce" value="false" />
    <preference name="UIWebViewBounce" value="false" />
    <preference name="DisallowOverscroll" value="true" />
    <preference name="SplashScreenDelay" value="4000" />
    <preference name="FadeSplashScreenDuration" value="2000" />
    <preference name="android-minSdkVersion" value="22" />
    <preference name="android-targetSdkVersion" value="33" />
    <preference name="BackupWebStorage" value="none" />
    <preference name="SplashScreen" value="screen" />
    <preference name="ShowSplashScreenSpinner" value="false" />
    <preference name="SplashScreenSpinnerColor" value="#FFFFFF" />
    <preference name="AndroidLaunchMode" value="singleTask" />
    <preference name="loadUrlTimeoutValue" value="700000" />
    <preference name="SplashShowOnlyFirstTime" value="false" />
    <preference name="deployment-target" value="11.0" />
    <preference name="AndroidPersistentFileLocation" value="Compatibility" />
    <preference name="AndroidWindowSplashScreenAnimatedIcon" value="resources/android-13-splash.png" />
    <preference name="AndroidWindowSplashScreenBackground" value="#008BE9" />
    <preference name="AndroidWindowSplashScreenIconBackgroundColor" value="#008BE9" />
    <platform name="ios">
        <splash height="1136" src="resources/ios/splash/Default-568h@2x~iphone.png" width="640" />
        <splash height="1334" src="resources/ios/splash/Default-667h.png" width="750" />
        <splash height="2208" src="resources/ios/splash/Default-736h.png" width="1242" />
        <splash height="1242" src="resources/ios/splash/Default-Landscape-736h.png" width="2208" />
        <splash height="1536" src="resources/ios/splash/Default-Landscape@2x~ipad.png" width="2048" />
        <splash height="2048" src="resources/ios/splash/Default-Landscape@~ipadpro.png" width="2732" />
        <splash height="768" src="resources/ios/splash/Default-Landscape~ipad.png" width="1024" />
        <splash height="2048" src="resources/ios/splash/Default-Portrait@2x~ipad.png" width="1536" />
        <splash height="2732" src="resources/ios/splash/Default-Portrait@~ipadpro.png" width="2048" />
        <splash height="1024" src="resources/ios/splash/Default-Portrait~ipad.png" width="768" />
        <splash height="960" src="resources/ios/splash/Default@2x~iphone.png" width="640" />
        <splash height="480" src="resources/ios/splash/Default~iphone.png" width="320" />
        <splash height="2732" src="resources/ios/splash/Default@2x~universal~anyany.png" width="2732" />
        <icon height="57" src="resources/ios/icon/icon.png" width="57" />
        <icon height="114" src="resources/ios/icon/[email protected]" width="114" />
        <icon height="40" src="resources/ios/icon/icon-40.png" width="40" />
        <icon height="80" src="resources/ios/icon/[email protected]" width="80" />
        <icon height="120" src="resources/ios/icon/[email protected]" width="120" />
        <icon height="50" src="resources/ios/icon/icon-50.png" width="50" />
        <icon height="100" src="resources/ios/icon/[email protected]" width="100" />
        <icon height="60" src="resources/ios/icon/icon-60.png" width="60" />
        <icon height="120" src="resources/ios/icon/[email protected]" width="120" />
        <icon height="180" src="resources/ios/icon/[email protected]" width="180" />
        <icon height="72" src="resources/ios/icon/icon-72.png" width="72" />
        <icon height="144" src="resources/ios/icon/[email protected]" width="144" />
        <icon height="76" src="resources/ios/icon/icon-76.png" width="76" />
        <icon height="152" src="resources/ios/icon/[email protected]" width="152" />
        <icon height="167" src="resources/ios/icon/[email protected]" width="167" />
        <icon height="29" src="resources/ios/icon/icon-small.png" width="29" />
        <icon height="58" src="resources/ios/icon/[email protected]" width="58" />
        <icon height="87" src="resources/ios/icon/[email protected]" width="87" />
        <icon height="1024" src="resources/ios/icon/icon-1024.png" width="1024" />
    </platform>
    <platform name="android">
        <splash density="land-ldpi" src="resources/android/splash/drawable-land-ldpi-screen.png" />
        <splash density="land-mdpi" src="resources/android/splash/drawable-land-mdpi-screen.png" />
        <splash density="land-hdpi" src="resources/android/splash/drawable-land-hdpi-screen.png" />
        <splash density="land-xhdpi" src="resources/android/splash/drawable-land-xhdpi-screen.png" />
        <splash density="land-xxhdpi" src="resources/android/splash/drawable-land-xxhdpi-screen.png" />
        <splash density="land-xxxhdpi" src="resources/android/splash/drawable-land-xxxhdpi-screen.png" />
        <splash density="port-ldpi" src="resources/android/splash/drawable-port-ldpi-screen.png" />
        <splash density="port-mdpi" src="resources/android/splash/drawable-port-mdpi-screen.png" />
        <splash density="port-hdpi" src="resources/android/splash/drawable-port-hdpi-screen.png" />
        <splash density="port-xhdpi" src="resources/android/splash/drawable-port-xhdpi-screen.png" />
        <splash density="port-xxhdpi" src="resources/android/splash/drawable-port-xxhdpi-screen.png" />
        <splash density="port-xxxhdpi" src="resources/android/splash/drawable-port-xxxhdpi-screen.png" />
        <resource-file src="resources/android/push/drawable-mdpi/ic_stat_onesignal_default.png" target="app/src/main/res/drawable-mdpi/ic_stat_onesignal_default.png" />
        <resource-file src="resources/android/push/drawable-hdpi/ic_stat_onesignal_default.png" target="app/src/main/res/drawable-hdpi/ic_stat_onesignal_default.png" />
        <resource-file src="resources/android/push/drawable-xhdpi/ic_stat_onesignal_default.png" target="app/src/main/res/drawable-xhdpi/ic_stat_onesignal_default.png" />
        <resource-file src="resources/android/push/drawable-xxhdpi/ic_stat_onesignal_default.png" target="app/src/main/res/drawable-xxhdpi/ic_stat_onesignal_default.png" />
        <resource-file src="resources/android/push/drawable-xxxhdpi/ic_stat_onesignal_default.png" target="app/src/main/res/drawable-xxxhdpi/ic_stat_onesignal_default.png" />
        <edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application">
            <application android:icon="@mipmap/ic_launcher" android:roundIcon="@mipmap/ic_launcher_round" />
            <application android:requestLegacyExternalStorage="true" />
            <application android:usesCleartextTraffic="true" />
        </edit-config>
        <edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application/activity">
            <activity android:exported="true" />
        </edit-config>
        <preference name="AndroidXEnabled" value="true" />
        <preference name="GradlePluginKotlinEnabled" value="true" />
        <resource-file src="resources/android/adaptiveicon/drawable/ic_launcher_background.xml" target="app/src/main/res/drawable/ic_launcher_background.xml" />
        <resource-file src="resources/android/adaptiveicon/drawable-v24/ic_launcher_foreground.xml" target="app/src/main/res/drawable-v24/ic_launcher_foreground.xml" />
        <resource-file src="resources/android/adaptiveicon/mipmap-anydpi-v26/ic_launcher.xml" target="app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml" />
        <resource-file src="resources/android/adaptiveicon/mipmap-anydpi-v26/ic_launcher_round.xml" target="app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml" />
        <resource-file src="resources/android/adaptiveicon/mipmap-hdpi/ic_launcher.png" target="app/src/main/res/mipmap-hdpi/ic_launcher.png" />
        <resource-file src="resources/android/adaptiveicon/mipmap-hdpi/ic_launcher_round.png" target="app/src/main/res/mipmap-hdpi/ic_launcher_round.png" />
        <resource-file src="resources/android/adaptiveicon/mipmap-hdpi/ic_launcher_background.png" target="app/src/main/res/mipmap-hdpi/ic_launcher_background.png" />
        <resource-file src="resources/android/adaptiveicon/mipmap-hdpi/ic_launcher_foreground.png" target="app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png" />
        <resource-file src="resources/android/adaptiveicon/mipmap-mdpi/ic_launcher.png" target="app/src/main/res/mipmap-mdpi/ic_launcher.png" />
        <resource-file src="resources/android/adaptiveicon/mipmap-mdpi/ic_launcher_round.png" target="app/src/main/res/mipmap-mdpi/ic_launcher_round.png" />
        <resource-file src="resources/android/adaptiveicon/mipmap-mdpi/ic_launcher_background.png" target="app/src/main/res/mipmap-mdpi/ic_launcher_background.png" />
        <resource-file src="resources/android/adaptiveicon/mipmap-mdpi/ic_launcher_foreground.png" target="app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png" />
        <resource-file src="resources/android/adaptiveicon/mipmap-xhdpi/ic_launcher.png" target="app/src/main/res/mipmap-xhdpi/ic_launcher.png" />
        <resource-file src="resources/android/adaptiveicon/mipmap-xhdpi/ic_launcher_round.png" target="app/src/main/res/mipmap-xhdpi/ic_launcher_round.png" />
        <resource-file src="resources/android/adaptiveicon/mipmap-xhdpi/ic_launcher_background.png" target="app/src/main/res/mipmap-xhdpi/ic_launcher_background.png" />
        <resource-file src="resources/android/adaptiveicon/mipmap-xhdpi/ic_launcher_foreground.png" target="app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png" />
        <resource-file src="resources/android/adaptiveicon/mipmap-xxhdpi/ic_launcher.png" target="app/src/main/res/mipmap-xxhdpi/ic_launcher.png" />
        <resource-file src="resources/android/adaptiveicon/mipmap-xxhdpi/ic_launcher_round.png" target="app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png" />
        <resource-file src="resources/android/adaptiveicon/mipmap-xxhdpi/ic_launcher_background.png" target="app/src/main/res/mipmap-xxhdpi/ic_launcher_background.png" />
        <resource-file src="resources/android/adaptiveicon/mipmap-xxhdpi/ic_launcher_foreground.png" target="app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png" />
        <resource-file src="resources/android/adaptiveicon/mipmap-xxxhdpi/ic_launcher.png" target="app/src/main/res/mipmap-xxxhdpi/ic_launcher.png" />
        <resource-file src="resources/android/adaptiveicon/mipmap-xxxhdpi/ic_launcher_round.png" target="app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png" />
        <resource-file src="resources/android/adaptiveicon/mipmap-xxxhdpi/ic_launcher_background.png" target="app/src/main/res/mipmap-xxxhdpi/ic_launcher_background.png" />
        <resource-file src="resources/android/adaptiveicon/mipmap-xxxhdpi/ic_launcher_foreground.png" target="app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png" />
        <icon density="ldpi" src="resources/android/icon/drawable-ldpi-icon.png" />
        <icon density="mdpi" src="resources/android/icon/drawable-mdpi-icon.png" />
        <icon density="hdpi" src="resources/android/icon/drawable-hdpi-icon.png" />
        <icon density="xhdpi" src="resources/android/icon/drawable-xhdpi-icon.png" />
        <icon density="xxhdpi" src="resources/android/icon/drawable-xxhdpi-icon.png" />
        <icon density="xxxhdpi" src="resources/android/icon/drawable-xxxhdpi-icon.png" />
    </platform>
    <icon src="resources/android/icon/drawable-xhdpi-icon.png" />
    <chcp>
        <config-file url="https://www.app.com/mobile/www/chcp.json" />
        <native-interface version="2.0.3.2" />
    </chcp>
    <config-file parent="./application" target="AndroidManifest.xml">
        <meta-data android:name="com.onesignal.NotificationAccentColor.DEFAULT" android:value="FF3696ED" />
    </config-file>
    <plugin name="cordova-plugin-headercolor" spec="^1.0.0" />
    <plugin name="cordova-plugin-ignore-lint-translation" spec="0.0.1" />
    <plugin name="cordova-plugin-zip" spec="^3.1.0" />
    <plugin name="cordova-plugin-statusbar" spec="git+https://github.com/apache/cordova-plugin-statusbar.git" />
    <plugin name="cordova-plugin-dialogs" spec="^2.0.2" />
    <plugin name="cordova-plugin-android-permissions" spec="^1.0.2" />
    <plugin name="cordova-plugin-ionic-keyboard" spec="^2.2.0" />
    <plugin name="cordova-plugin-network-information" spec="^2.0.2" />
    <plugin name="cordova-plugin-device" spec="^2.0.3" />
    <plugin name="cordova-plugin-file-opener2" spec="^2.2.1">
        <variable name="ANDROID_SUPPORT_V4_VERSION" value="27.+" />
    </plugin>
    <plugin name="ionic-plugin-deeplinks" spec="^1.0.15">
        <variable name="URL_SCHEME" value="app" />
        <variable name="DEEPLINK_SCHEME" value="https" />
        <variable name="DEEPLINK_HOST" value="www.app.com" />
        <variable name="ANDROID_PATH_PREFIX" value="/app" />
        <variable name="ANDROID_2_PATH_PREFIX" value="/" />
        <variable name="ANDROID_3_PATH_PREFIX" value="/" />
        <variable name="ANDROID_4_PATH_PREFIX" value="/" />
        <variable name="ANDROID_5_PATH_PREFIX" value="/" />
        <variable name="DEEPLINK_2_SCHEME" value=" " />
        <variable name="DEEPLINK_2_HOST" value=" " />
        <variable name="DEEPLINK_3_SCHEME" value=" " />
        <variable name="DEEPLINK_3_HOST" value=" " />
        <variable name="DEEPLINK_4_SCHEME" value=" " />
        <variable name="DEEPLINK_4_HOST" value=" " />
        <variable name="DEEPLINK_5_SCHEME" value=" " />
        <variable name="DEEPLINK_5_HOST" value=" " />
    </plugin>
    <plugin name="cordova-plugin-splashscreen" spec="^6.0.0" />
    <plugin name="cordova-plugin-androidx-adapter" spec="^1.1.3" />
    <plugin name="onesignal-cordova-plugin" spec="^3.3.1" />
    <plugin name="cordova-plugin-androidx" spec="^3.0.0" />
    <plugin name="cordova-plugin-file" spec="^8.0.0" />
    <plugin name="cordova-plugin-file-transfer" spec="^2.0.0" />
    <engine name="ios" spec="^6.1.1" />
    <engine name="android" />
</widget>

Where is the conflict? Please help.

@Mr-Anonymous
Copy link

Mr-Anonymous commented Jan 2, 2024

I basically removed everything from my config.xml file and I still get this error.

This is my ionic info:

Ionic:

   Ionic CLI         : 6.18.1 (/Users/me/.nvm/versions/node/v18.18.2/lib/node_modules/@ionic/cli)
   Ionic Framework   : ionic1 1.3.3
   @ionic/v1-toolkit : 1.0.9

Cordova:

   Cordova CLI       : 12.0.0 ([email protected])
   Cordova Platforms : android 12.0.0, ios 6.1.1
   Cordova Plugins   : cordova-plugin-ionic-keyboard 2.2.0, (and 17 other plugins)

Utility:

   cordova-res : not installed globally
   native-run  : not installed globally

System:

   Android SDK Tools : 26.1.1 (/Users/me/Library/Android/sdk)
   ios-sim           : 8.0.2
   NodeJS            : v18.18.2 (/Users/me/.nvm/versions/node/v18.18.2/bin/node)
   npm               : 6.14.7
   OS                : macOS Monterey
   Xcode             : Xcode 14.2 Build version 14C18

My plugins list:

cordova-plugin-add-swift-support 2.0.2 "AddSwiftSupport"
cordova-plugin-android-permissions 1.0.2 "Permissions"
cordova-plugin-androidx-adapter 1.1.3 "cordova-plugin-androidx-adapter"
cordova-plugin-androidx 3.0.0 "cordova-plugin-androidx"
cordova-plugin-device 2.0.3 "Device"
cordova-plugin-dialogs 2.0.2 "Notification"
cordova-plugin-file-opener2 2.2.1 "File Opener2"
cordova-plugin-file-transfer 2.0.0 "File Transfer"
cordova-plugin-file 8.0.0 "File"
cordova-plugin-headercolor 1.0 "HeaderColor"
cordova-plugin-ignore-lint-translation 0.0.1 "cordova-plugin-ignore-lint-translation"
cordova-plugin-ionic-keyboard 2.2.0 "cordova-plugin-ionic-keyboard"
cordova-plugin-ios-camera-permissions 1.2.0 "iOS Permissions"
cordova-plugin-mediapicker-dmcsdk 2.5.1 "MediaPicker"
cordova-plugin-network-information 2.0.2 "Network Information"
cordova-plugin-splashscreen 6.0.0 "Splashscreen"
cordova-plugin-statusbar 2.4.4-dev "StatusBar"
cordova-plugin-zip 3.1.0 "cordova-plugin-zip"
ionic-plugin-deeplinks 1.0.15 "Ionic Deeplink Plugin"
onesignal-cordova-plugin 3.3.1 "OneSignal Push Notifications"

@Mr-Anonymous
Copy link

@DmcSDK Do you have any solution for this please? I am unable to install this plugin due to this error.

@kenfouo
Copy link

kenfouo commented Jan 8, 2024

I have same probleme !

Failed to install 'cordova-plugin-mediapicker-dmcsdk': TypeError: Cannot read properties of undefined (reading 'id')
at registerConflict (C:\Users\Borientm\CordovaProjects\Further Market\node_modules\cordova-common\src\ConfigChanges\ConfigChanges.js:253:43)
at C:\Users\Borientm\CordovaProjects\Further Market\node_modules\cordova-common\src\ConfigChanges\ConfigChanges.js:278:34
at Array.forEach ()
at PlatformMunger._is_conflicting (C:\Users\Borientm\CordovaProjects\Further Market\node_modules\cordova-common\src\ConfigChanges\ConfigChanges.js:257:21)
at PlatformMunger.add_plugin_changes (C:\Users\Borientm\CordovaProjects\Further Market\node_modules\cordova-common\src\ConfigChanges\ConfigChanges.js:106:59)
at C:\Users\Borientm\CordovaProjects\Further Market\node_modules\cordova-common\src\PluginManager.js:120:33
Cannot read properties of undefined (reading 'id')

@kenfouo
Copy link

kenfouo commented Jan 9, 2024

hello this is what worked for me.
The plugin.xml file necessarily contains a property that already exists in your manifest file. in my case it was android:requestLegacyExternalStorage="true".

To solve the problem I deleted the following block in plugin.xml and then I installed the plugin locally.

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

@Mr-Anonymous
Copy link

Thank you so much @kenfouo Very kind of you to share that. I will remove the requestLegacyExternalStorage="true" and try it.

@Mr-Anonymous
Copy link

@kenfouo Removing the requestLegacyExternalStorage="true" from config.xml and AndroidManifest.xml file still gives me the conflict error when adding this plugin. Maybe another plugin is causing it too I am not sure.

I wanna try your other method. After I delete the <edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application" xmlns:android="http://schemas.android.com/apk/res/android"> <application android:requestLegacyExternalStorage="true" /> </edit-config> from plugin.xml, how did you install the plugin locally?

@Mr-Anonymous
Copy link

Ok, I forked this plugin, removed the requestLegacyExternalStorage from plugin.xml and installed it. This time the plugin got added without the conflict error. But this is now causing another error when I tried to build it which is posted here: #134

Still struggling to install this plugin as a result!

@kenfouo
Copy link

kenfouo commented Jan 9, 2024

Ok, j'ai créé ce plugin, supprimé le requestLegacyExternalStoragefichier plugin.xml et l'ai installé. Cette fois, le plugin a été ajouté sans erreur de conflit. Mais cela provoque maintenant une autre erreur lorsque j'ai essayé de le construire, qui est publiée ici : #134

J'ai toujours du mal à installer ce plugin du coup !

No, this is a construction problem and not a plugin installation problem.

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

3 participants