duplicated with element declared at AndroidManifest.xml #418
Comments
Can't see your AndroidManifest.xml, please properly escape your code... |
I just ran into the same issue building after updating from v6.0.1 to v6.0.6.
|
I found that after removing the plugin
The following element remained in AndroidManifest.xml and would be added again on each build attempt.
I deleted the top level AndroidManifest.xml as well as the same file from
and
I also deleted the android.json file from
I was then able to install the latest version of the plugin and build successfully. |
@mmaannss so the problem has gone away after removing and re-adding the platform? |
Yeah, I initially tried just removing the extra element from AndroidManifest.xml but it gets put back in there if you don't get rid of it everywhere. |
I still have this problem. The steps of jbankester to delete the manifest and install the plugin again and build for Android did not work. Does anyone else have a solution? |
|
@mmaannss Hi, I'm having the same issue with "duplicated element declared at AndroidManifest.xml" after I've installed this barcode scanner. But for my case, there's multiple permission request on Camera and the cause of this issue is having cordova-plugin-qrscanner and phonegap-plugin-barcodescanner installed and both of the plugins is requesting the same permission. After I've removed the cordova-plugin-qrscanner everything went smooth. |
Does this mean it is not possible to have multiple plugins that use the camera used by a cordova app, even if the app does not use both plugins at the same time? Simply because they both need to ask for the same permission? |
I have the same issue and it seems to be caused of that I use two plugins that both uses the feature camera, but one also requires it.
So is the issue that it does not reconize that the use feature is there already since it uses the required =true flag? |
@atlesp I got exactly the same problem. Cordova is also generating those two lines in my app and i can not get it to build anymore. Did you already find a solution other than removing one of the plugins? Removing a plugin is not an option for me. |
@derrohrbach I did not find a solution. Since my app is only targeting IOS, this wa not a blocker for me. I guess this is a bug in cordova, and not this plugin. A possible hack solution could be to clone this repo and remove the "android:required="true"" from this plugin (see https://github.com/phonegap/phonegap-plugin-barcodescanner/blob/master/plugin.xml) and then use the git clone repo assoruce. But I am not sure if it will work. |
Not a great or long term solution but you can fork one of the projects and changes |
Seems like more an issue with cordova rather than this plugin. If someone has some quick reproduction steps can they share? Maybe something like:
I (or that person) can then create an issue in the cordova jira |
@wildabeast First off: Thx for your patience The conflict in my App is between |
What phonegap version are you running? This compiled successfully for me for me:
|
I am running cordova in version 7.0.1. If I run exactly those commands but using cordova instead of phonegap, then i get the following error message while building:
|
Thanks, managed to reproduce with 7.0.1. It looks like this problem has been reported a couple of times in one form or the other in the Cordova Jira, with no firm solution. So I guess we're in a "wait / hope it gets fixed" status. A temporary solution would be forking one of the plugins and removing the problematic permissions/features, and let them be injected by the other plugin, or creating a hook which fixes the manifest for you before building. |
After scratching my head over this for 2 days, I finally switched to this plugin and things have worked well since then. |
Removing and adding again android platform |
I had the sane issue with cordova-plugin-camera and phonegap-plugin-barcodescanner. My fix:
Next remove the phonegap-plugin-barcodescanner of the package.json. Run:
Next do a new build:
Next add the plugin again:
|
I had to remove inside ..\plugins\phonegap-plugin-barcodescanner\plugin.xml the
then removed and added again android platform. |
@ctpaula 🥇 No need to fork the barcode-scanner repostiory. Just follow ctpaula's steps: -Comment the line of 'uses-feature' in ...\plugins\phonegap-plugin-barcodescanner\plugin.xml Works like a charm! |
@afficionaddo it's not working for me, it give me the following issue
|
@cristianizzo From @justinhenricks, seem QR Scanner and Barcode Scanner cannot be installed at the same time, here the related issue #510 |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This thread has been automatically locked. |
hello everyone i have a problem which is the following when i run
--> ionic run android
and this is AndroidManifest.xml
The text was updated successfully, but these errors were encountered: