You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by GitBox <gi...@apache.org> on 2020/12/31 12:33:57 UTC

[GitHub] [cordova-common] QuentinFarizon opened a new issue #155: config-file conflicts between plugins and config.xml

QuentinFarizon opened a new issue #155:
URL: https://github.com/apache/cordova-common/issues/155


   # Bug Report
   
   ## Problem
   
   I am using https://github.com/QuentinFarizon/cordova-plugin-ble-central/tree/dfu in which plugin.xml adds two tags inside  AndroidManufest application tag : https://github.com/QuentinFarizon/cordova-plugin-ble-central/blob/dfu/plugin.xml#L76-L79
   
   I am also using https://github.com/dpa99c/cordova-plugin-firebasex that documents (https://github.com/dpa99c/cordova-plugin-firebasex/#android-default-notification-icon) adding this to my config.xml :
   ```
   <platform name="android">
       <config-file target="AndroidManifest.xml" parent="/manifest/application">
           <meta-data android:name="com.google.firebase.messaging.default_notification_icon" android:resource="@drawable/notification_icon" />
       </config-file>
   </platform>
   ```
   
   ### What is expected to happen?
   
   No conflict should occur, it should result in :
   <application (....)>
      <meta-data android:name="com.google.firebase.messaging.default_notification_icon" android:resource="@drawable/notification_icon" />
       <activity android:name="com.megster.cordova.ble.central.NotificationActivity" />
       <service android:name="com.megster.cordova.ble.central.DfuService" />
       (...)
   </application>
   
   ### What does actually happen?
   
   During platform/plugin add, everythings goes fine.
   
   Juste before build, AndroidManifest is correct (all lines are present).
   
   During build, this message : "Conflict found, edit-config changes from config.xml will overwrite plugin.xml changes"
   activity and service tags from com.megster.cordova.ble.central are NOT added to AndroidManifest (they have been removed).
   
   While debugging inside cordova-common, I can see here the details of conflict :
   ```
   {
      "conflictFound":true,
      "conflictingMunge":{
         "files":{
            "AndroidManifest.xml":{
               "parents":{
                  "/manifest/application":[
                     {
                        "xml":"<activity android:name=\"com.megster.cordova.ble.central.NotificationActivity\" />",
                        "count":1
                     },
                     {
                        "xml":"<service android:name=\"com.megster.cordova.ble.central.DfuService\" />",
                        "count":1
                     },
                     {
                        "xml":"<meta-data android:name=\"com.google.firebase.messaging.default_notification_icon\" android:resource=\"@drawable/notification_icon\" />",
                        "count":0,
                        "id":"config.xml"
                     }
                  ]
               }
            }
         }
      },
      "configxmlMunge":{
         "files":{
            
         }
      },
      "conflictWithConfigxml":false,
      "noChanges":[
         
      ],
      "unusedConfigMunge":{
         "files":{
            "AndroidManifest.xml":{
               "parents":{
                  "/manifest/application":[
                     {
                        "xml":"<meta-data android:name=\"com.google.firebase.messaging.default_notification_icon\" android:resource=\"@drawable/notification_icon\" />",
                        "count":1,
                        "id":"config.xml"
                     }
                  ]
               }
            }
         }
      }
   }
   ```
   
   
   ## Information
   
   Apart from the conflict issue, I think the build should definitely fail if some configurations lines from plugins are removed without more than a warning console line.
   
   
   ### Command or Code
   <!-- What command or code is needed to reproduce the problem? -->
   ionic cordova build
   
   
   ### Environment, Platform, Device
   Reproduced on ubuntu and macOS
   
   ### Version information
   cordova 9.0.0
   cordova-android 9.0.0
   (tested with cordova 10 also, no luck)
   
   
   ## Checklist
   <!-- Please check the boxes by putting an x in the [ ] like so: [x] -->
   
   - [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
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org