android.hardware.location.gps added twice in androidManifest
I have two plugins that uses location. Yours and Google Maps: https://github.com/mapsplugin/cordova-plugin-googlemaps
This way there are two tags <uses-feature android:name="android.hardware.location.gps" /> in AndroidManifest.xml file :/
Tried adding
<edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/uses-feature[@android:name='android.hardware.location.gps']" xmlns:android="http://schemas.android.com/apk/res/android">
<uses-feature android:name="android.hardware.location.gps" />
</edit-config>
to config.xml file but it is not helping. How to solve it?
I also have the same problem. build error. any solutions?
i have fixed this error by open this project from platform folder with android studio. 1)open search file window by double press shift button 2) find "android.json" file and open it 3) find word "gps" and remove duplicate entry 4) try ionic cordova build android now 5) open android manifest file and remove duplicate entry for gps. again can take build in either android studio or ionic cordova build android will solve this issue.
Happy coding. cheers
Unfortunately the two plugins conflicts because they and this plugin boht uses <config-file> directive which always inserts the contents into the target which obviously leads into duplicates.
In order to use this plugin alongside with google maps plugin, a hook will probably have to be made to dedupe the android manifest entry.
And after_prepare hook to scan and remove one occurence <uses-feature android:name="android.hardware.location.gps" /> should do it (along with any other duplicates caused by the same issue).
Manually modifying the project will work, but there are many actions that may cause the project to be re-prepared/reconstructed and you'll have to remember to manually fix it each time that happens, whereas the hook can automate that for you.
Closing because it's not really a bug with this plugin or cordova in general. But we are aware of problems with the config-file/edit-config directives.