首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >三星Galaxy S8设备上的SecurityException

三星Galaxy S8设备上的SecurityException
EN

Stack Overflow用户
提问于 2018-03-22 17:00:46
回答 1查看 332关注 0票数 3

根据Crashlytics的说法,我们的Android应用程序的一个特定用户群经历了以下崩溃。

代码语言:javascript
复制
Fatal Exception: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.bundle.id/com.bundle.id.MainActivity}: java.lang.SecurityException: uid 10346 cannot get secrets for accounts of type: com.osp.app.signin
       at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2955)
       at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3030)
       at android.app.ActivityThread.-wrap11(Unknown Source)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1696)
       at android.os.Handler.dispatchMessage(Handler.java:105)
       at android.os.Looper.loop(Looper.java:164)
       at android.app.ActivityThread.main(ActivityThread.java:6938)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)

我们在谷歌上搜索,试图复制,但都没有成功。根据Crashlytics的说法,这种情况只发生在三星的Galaxy S8设备上。

我们已经用一个进行了测试,但它工作得很好。有没有人以前见过这个错误,或者知道导致这个错误的原因是什么?这真的很令人沮丧。

EN

回答 1

Stack Overflow用户

发布于 2020-01-31 08:17:09

不确定OP的问题是什么,但我遇到了同样的崩溃,结果发现问题是我从addOnAccountsUpdatedListener获取Account对象。在大多数设备上,您从该接口获得的列表将根据您的accountType进行过滤。在某些三星设备上,如果设置了三星帐户,它还会包括手机上的三星帐户。解决方法:

代码语言:javascript
复制
    accountManager.addOnAccountsUpdatedListener({ accounts ->
      // Samsung is great: it sends us updates on Samsung accounts even though the accountType
      // doesn't match.
      val ourUpdatedAccounts = accounts.filter { account -> account.type == myAccountType }
      // do something with ourUpdatedAccounts
    }, Handler(), false)
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/49424373

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档