【问题标题】:getting caller uid 10066 is different than the authenticator's uid [duplicate]获取调用者 uid 10066 与验证者的 uid 不同 [重复]
【发布时间】:2011-09-22 07:28:51
【问题描述】:

我正在使用以下代码将帐户添加到帐户列表中

final AccountManager accountMgr = AccountManager.get(this.getApplicationContext());
 Account ac = new Account("my.id","com.google");
try{
      accountMgr.addAccountExplicitly(ac, "password", null);}
catch(Exception e){
 String str = e.getLocalizedMessage();
 Log.e("err",str);
}

但每次都会出现以下错误: 'caller uid 10066 is different than the authenticator's uid'

【问题讨论】:

    标签: android accountmanager


    【解决方案1】:

    下面的stackoverflow问题似乎解决了这个问题:

    SecurityException: caller uid XXXX is different than the authenticator's uid

    它链接到的文章 (http://loganandandy.tumblr.com/post/613041897/caller-uid-is-different) 解释了整个事情,尽管我花了一分钟才意识到最后一个 xml sn-p 指的是我的代码的哪一部分。

    我最终将我的帐户类型和身份验证令牌类型存储在我的 strings.xml 中,并根据需要在 authenticationator.xml 和代码中引用它们。

    【讨论】:

    • 最好只存储一次并从两个地方引用它。
    • @Tzrlk 你能显示一些你做了什么的代码吗?谢谢!
    • 所以即使我的 XML 文件中没有不匹配,我仍然会遇到此崩溃。事实上,崩溃是随机发生在极少数人的设备上的。这对你们所有人来说都是一致的吗?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-04-08
    • 1970-01-01
    • 2018-02-10
    • 1970-01-01
    • 2021-08-24
    • 1970-01-01
    相关资源
    最近更新 更多