Add android.permission.CAMERA with Cordova

I am using the latest version of Cordoba (6.3.1) and I want the following permission to appear in AndroidManifest.xml:

<uses-permission android:name="android.permission.CAMERA" />

Adding this line manually does not work, because the XML is regenerated every time I run the command cordova run android

I added cordova-plugin-camerato my project with

cordova plugin add cordova-plugin-camera

This plugin DOES NOT add CAMERA permissions to AndroidManifest.xml

I do not know if this is normal

How to add this permission to my project?


Edit: Typically, Cordoba plugins are responsible for adding the necessary permissions to the manifest. The camera plugin does not add this specific permission, interestingly:

  • if the plugin should add this permission (bug? I opened the problem on my Jira tracker)
  • , , config.xml
+4
2

, Camera - AndroidManifest.xml. Github, WRITE_EXTERNAL_STORAGE 2013 (CB-3654), . , , AndroidManifest.xml , config-file config.xml, :

    <config-file target="AndroidManifest.xml" parent="/*" mode="merge">
        <uses-permission android:name="android.permission.CAMERA" />
        <uses-feature android:name="android.hardware.camera" />
        <uses-feature android:name="android.hardware.camera.autofocus" />
    </config-file>
+3

Source: https://habr.com/ru/post/1652489/


All Articles