2

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.

4

2 回答 2

1

添加能力有两种方式:

  1. <DeviceCapability Name="microphone" />像这样在文件的 Capabilities 标签内添加package.windows10.appxmanifest

    <Capabilities>
      <Capability Name="internetClient" />
      <DeviceCapability Name="microphone" />
    </Capabilities>
    
  2. 导航到项目的根文件夹。打开命令行窗口并输入cordova platform update windows命令以更新 Windows 平台。<DeviceCapability Name="microphone" />将被添加到清单文件中。

于 2016-04-08T09:20:19.497 回答
0

看起来我受到了阻止更新清单文件中的功能的错误的影响。cordova-windows@4.3.1

cordova-windows@4.3.2截至4 月 5 日发布,该问题已得到解决。

于 2016-04-12T09:00:27.153 回答