简体   繁体   English

科尔多瓦config.xml android权限

[英]cordova config.xml android permissions

I am attempting to run the Android version of my PhoneGap (Cordova) app, and it's not listing the proper permissions. 我正在尝试运行Android版的PhoneGap(Cordova)应用,但未列出适当的权限。

When I install the app, it says it needs permission to record audio, access the file-system, network connections, etc. It does not say anything about the Camera or the Internet -- both of which I need. 当我安装该应用程序时,它说它需要录制音频,访问文件系统,网络连接等权限。它没有说任何有关“相机”或Internet的信息-我都需要。

How do I set those permissions in the config.xml file? 如何在config.xml文件中设置这些权限?

I have googled the heck out of this, and I see a bunch of people talking about editing the Android-Manifest.xml file -- but that file is ALWAYS overwritten as soon as I type "phonegap build android". 我已经用谷歌搜索了一下,我看到很多人在谈论编辑Android-Manifest.xml文件-但是,只要我键入“ phonegap build android”,该文件就会被覆盖。 So whatever modifications I make, they need to be in the Config.xml file! 因此,无论我进行什么修改,它们都必须位于Config.xml文件中!

I have also found numerous references to things that look like: 我还发现了很多类似的东西:

<feature name="http://api.phonegap.com/1.0/camera />

But I was under the impression that those <feature> tags were deprecated back in PhoneGap 2.0? 但是我给人的印象是,这些<feature>标签在PhoneGap 2.0中被弃用了? At any rate, I tried them, and they do not work. 无论如何,我尝试了它们,但它们不起作用。

The permissions should be set when you install a plugin : camera permission with the camera plugin... 安装插件时应设置权限:带相机插件的相机权限...

And when you build the android app, the permissions are added to the androidmanifest.xml file. 并且,当您构建android应用时,权限会添加到androidmanifest.xml文件中。

I think the network permission are part of the "by default" permissions, so it's quite strange you don't have it... 我认为网络权限是“默认”权限的一部分,所以很奇怪您没有它。

I would suggest you remove all plugins and the android platform, then re-add the plugins and re-create the android platform. 我建议您删除所有插件和android平台,然后重新添加插件并重新创建android平台。 (the easiest is to manually delete the platforms/android and plugins folders in your app) (最简单的方法是在应用中手动删除platform / android和plugins文件夹)

It may help you 可能对你有帮助

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM