cordovawindows-10-universaltaco

Cordova not adding capabilities to appxmanifest file


I'm using Visual Studio 2015 (Update 2) to build an app using Apache Cordova. This app uses the cordova-plugin-media plugin for recording audio. However, when I try to record audio, I get this error: Access is denied.

Looking at the generated package.windows10.appxmanifest file in \platforms\windows, I don't see the microphone capability in there. There's is only one capability:

<Capability Name="internetClient" />

So the microphone capability is missing. However, this is what I find in windows.json:

"config_munge": {
    "files": {
        "package.appxmanifest": {
            "parents": {
                "/Package/Capabilities": [
                    {
                        "xml": "<DeviceCapability Name=\"microphone\" />",
                        "count": 1
                    }
                ]
            }
        }
    }
}

What can I do to make sure this capability is properly added to the generated manifest(s)? Notice the different name: package.appxmanifest in windows.json, whereare the generated manifest is actually package.windows10.appxmanifest.

This is with Cordova 6.1.1 and Cordova@Windows 4.3.1.


Solution

  • It looks like I was affected by a bug in cordova-windows@4.3.1 which prevented capabilities in the manifest file from being updated.

    The issue has been resolved as of cordova-windows@4.3.2, which was release April 5th.