的Xamarin的Andr​​oid应用程序突然需要外部存储权限

的Xamarin的Andr​​oid应用程序突然需要外部存储权限

本文介绍了为什么我的Xamarin的Andr​​oid应用程序突然需要外部存储权限?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Xamarin的Andr​​oid应用程序我一直在试图创造一个更新。权当一切都被吸引住了,工作了,我终于做出了释放APK,我从谷歌的消息播放的上传APK现在需要两个额外的权限。对于读取和写入外部存储!我没有在我的应用需要在所有这些权限。我想看着我的项目的Andr​​oid清单,看到那里列出没有这样的权限。我的应用程序的旧版本(使用旧版本的Andr​​oid Xamarin的)并不需要这些权限。为什么会突然Xamarin被注射权限,我没有指定?

I have a Xamarin Android application I've been trying to create an update for. Right when everything was hooked up and working, and I finally made the release APK, I get a message from Google Play that the uploaded APK now requires two extra permissions. For reading and writing to external storage! I don't need these permissions in my application at all. I tried looking at my project's Android Manifest, and saw no such permissions listed there. Older versions of my application (using older versions of Xamarin Android) did not require these permissions. Why would Xamarin suddenly be injecting permissions I didn't specify?

我可以证实,这是与任何应用程序的情况。我刚刚创建了一个新的Andr​​oid应用它,它需要外部的读/写权限,没有明显的方法来禁用该要求

I can confirm that this is the case with any application. I just created a new android app with it, and it requires external read/write permissions, with no apparent way to disable that requirement

推荐答案

查看的AssemblyInfo.cs ,默认模板有这个在它的底部:

Look in AssemblyInfo.cs, default template has this on the bottom of it:

[assembly: UsesPermission(Android.Manifest.Permission.Internet)]
[assembly: UsesPermission(Android.Manifest.Permission.WriteExternalStorage)]

权限可以设置既可以通过的Andr​​oidManifest.xml 文件或通过的AssemblyInfo.cs 。删除这些线和权限不应该再设置。

Permissions can be set either through the AndroidManifest.xml file or through AssemblyInfo.cs. Delete those lines, and the permissions should not be set anymore.

这篇关于为什么我的Xamarin的Andr​​oid应用程序突然需要外部存储权限?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-02 05:49