权限不工作 [英] Permissions Not Working

查看:213
本文介绍了权限不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直有一些奇怪的问题,在Android的许可。我想只得到一个列表的谷歌日历的特定用户,但首先我需要让他们挑的帐户。

I've been having some odd problems with permission in Android. I am trying to just get a list of the google calendars a particular user has, but first I need to let them pick the account.

我列入此行我的清单:

<uses-permission android:name="android.permission.GET_ACCOUNTS"></uses-permission>

不过,我得到这个错误:

However I get this error:

12-26 03:26:31.004 13841 13841 E AndroidRuntime: java.lang.RuntimeException: Unable to start activity ComponentInfo{....}: java.lang.SecurityException: caller uid 10105 lacks any of android.permission.GET_ACCOUNTS

我曾试图与获得访问无证日历API与 READ_CALENDAR WRITE_CALENDAR 类似的东西,但我有类似的例外(虽然可能出于不同的原因 - 我想这可能是值得一提的情况下,它是不是)

I had tried something similar with gaining access to the undocumented Calendar API with READ_CALENDAR and WRITE_CALENDAR, but I had similar exceptions (although probably for different reasons - I thought it might be worth mentioning in case it wasn't).

请给我介绍什么我做错了!

Please clue me in on what I'm doing wrong!

谢谢!

推荐答案

无论你的&LT;使用-许可&GT; 是在错误的地方(应该是一个孩子&LT;舱单&GT; ℃的对等;用途&gt; )或 GET_ACCOUNTS 不是一个权限,该SDK应用程序可以持有。该文档是奇烂有关指示哪些权限,而且没有资格SDK应用程序。

Either your <uses-permission> is in the wrong place (should be a child of <manifest> and a peer of <application>), or GET_ACCOUNTS is not a permission that SDK applications can hold. The documentation is singularly lousy about indicating which permissions are and are not eligible for SDK applications.

这篇关于权限不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆