Joannanas edited a comment on issue #857:
URL: https://github.com/apache/cordova-android/issues/857#issuecomment-773281683
I just struggled for a few days with a related and pretty annoying issue,
and my conclusion might help to isolate the case. Everytime I run the "cordova
run android" command line, it detects some non-existent conflict for the
AndroidManifest and deletes one by one every permission added by the
phonegap-barcodescanner used by my app, along with one of the "edit-config"
from the cordova-plugin-push (this is what made me question everything)
I thought that maybe I add something written in my config.xml file that
really made a conflict, but I have no permission change in it, so the content
of the config.xml alone is not the issue here.
I tried the verbose option but it does not explicitly tell what is in
conflict, so i tried to comment everything I have in my config.xml file, and I
figured out that the conflict comes from trying to merge config into the
application as follow :
```xml
<edit-config file="AndroidManifest.xml" mode="merge"
target="/manifest/application">
<application android:theme="@style/AppTheme"/>
</edit-config>
```
It seems also relevant to say that I do not use the option "--force" when
adding a plugin, but I still only have this small warning line "Conflict found,
edit-config changes from config.xml will overwrite plugin.xml changes"
everytime I use the "cordova run android" command, ONLY when I have the
previous merge in my config.xml file. If I comment it, no conflict is detected
and all my permissions/edit-config stay in the generated AndroidManifest.
So, **TLDR**, my permissions are deleted when doing `cordova run
android`command by the fact that I have an edit-config trying to merge an
atrribute to my application tag. The edit-config is then done, but every run
command deletes some line from the generated AndroidManifext.xml.
**EDIT ** To solve my problem, but it might not be possible for everybody, I
moved my "faulty" edit-config from the config.xml, to the plugin.xml of one of
my home made utils plugin. With that and so far, I have no warning when adding
the plugin and everything is in my generated AndroidManifest.
----------------------------------------------------------------
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:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]