java.lang.IllegalStateException:凭证加密存储中的 SharedPreferences 在用户解锁之前不可用

2023-12-24

Google Pixel 设备(OS 9.0-pie)上的 cashlytics 中不会记录崩溃,Playstore 将 ANR&Crashes 报告为 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

有没有人遇到过类似的问题。任何人都可以帮助解决这个问题吗?


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

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

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

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

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

java.lang.IllegalStateException:凭证加密存储中的 SharedPreferences 在用户解锁之前不可用 的相关文章

随机推荐