admin管理员组

文章数量:1548498

我写了一个简单的Hello World应用程序来调试我遇到的一些权限问题.

问题是我的应用无法获得使用任何内容的权限.是的,我正在使用

是的,我把那个标签放在< manifest>下面在AndroidManifest.xml中

如果我删除所有< uses-permission>清单中的标签,然后转到设置>应用> TestApp,它说没有请求权限

如果我重新放入标签,则说没有授予权限

如果我在实际设备上进行调试,它会说权限存在,所以看起来这个问题只发生在模拟器上!但是,当我使用相同的模拟器从developer.android运行android-play-location / LocationUpdates项目时它也有效,所以可能我的项目设置有问题.

有任何想法吗?

> IDE:Android Studio

>虚拟设备:Nexus_5_API_23

>操作系统:客户端Ubuntu 14.04在主机OS X Yosemite上运行(VMWare Fusion)

解决方法:

If I put the tags back in, it says No permissions granted

这是因为您在Android 6.0上进行测试,而您的targetSdkVersion设置为23.

If I debug on an actual device, it says the permissions are there so it looks like this problem is only occurring on the emulator!

不,它仅在Android 6.0上发生.

However, it also works when I run the android-play-location/LocationUpdates project from developer.android using the same emulator so maybe there’s something wrong with my project setup.

该项目可能有一个低于23的targetSdkVersion.

ACCESS_FINE_LOCATION由the Android 6.0 runtime permission system管理.要么更新您的应用程序以使用该系统,要么将targetSdkVersion降至23以下,直到您准备好这样做.

标签:android,permissions,location

来源: https://codeday.me/bug/20190717/1489011.html

本文标签: 权限模拟器器上android