【问题标题】:java.lang.IllegalStateException: SharedPreferences in credential encrypted storage are not available until after user is unlockedjava.lang.IllegalStateException:凭据加密存储中的 SharedPreferences 在用户解锁之前不可用
【发布时间】:2019-08-24 03:30:47
【问题描述】:

崩溃未在 Google Pixel 设备(OS 9.0-pie)上登录 cashlytics,Playstore 将 ANR 和崩溃报告为 java.lang.IllegalStateException:凭据加密存储中的 SharedPreferences 直到用户解锁后才可用

在初始化 Fabric.with(this, new Crashlytics()) 时发生这种情况,还观察到在设备重新启动时抛出 IllegalStateException 并且应用程序注册了 LOCKED_BOOT_COMPLETED 和 BOOT_COMPLETED 广播意图

E/AndroidRuntime: FATAL EXCEPTION: main
   Process: com.connect, PID: 2328
   java.lang.RuntimeException: Unable to create application com..common.app.AppApplication: java.lang.IllegalStateException: SharedPreferences in credential encrypted storage are not available until after user is unlocked
       at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5925)
       at android.app.ActivityThread.access$1100(ActivityThread.java:200)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1656)
       at android.os.Handler.dispatchMessage(Handler.java:106)
       at android.os.Looper.loop(Looper.java:193)
       at android.app.ActivityThread.main(ActivityThread.java:6718)
       at java.lang.reflect.Method.invoke(Native Method)
       at

有没有人遇到过类似的问题。谁能帮忙解决这个问题?

【问题讨论】:

  • 你能在同一设备的模拟器版本中复制这个吗?

标签: android crashlytics google-fabric google-pixel


【解决方案1】:

我自己没有遇到过这个问题,但是这里有一篇文章讨论了支持直接启动模式。

https://developer.android.com/training/articles/direct-boot

这里还有一个来自 Google 的 Github 链接,展示了如何访问设备的加密存储空间。在 AlarmStorage 类中。

https://github.com/googlesamples/android-DirectBoot/

【讨论】:

    猜你喜欢
    • 2018-09-19
    • 1970-01-01
    • 2023-04-02
    • 1970-01-01
    • 1970-01-01
    • 2013-09-09
    • 2014-11-16
    • 1970-01-01
    • 2017-09-05
    相关资源
    最近更新 更多