Open kozyrevsergey89 opened 3 years ago
Still running into this issue with ACRA 5.11.3 when the Application is starting on LOCKED_BOOT_COMPLETED and calling ACRA.init(). If there is no general solution, is there a chance to add a method to ACRA.init() to set the context for the preference storage manually?
Hi,
I'm using segment version 4.8.2 and got a crash on Android 11 (no issues on previous OS versions).
java.lang.IllegalStateException: SharedPreferences in credential encrypted storage are not available until after user is unlocked at android.app.ContextImpl.getSharedPreferences(ContextImpl.java:494) at android.app.ContextImpl.getSharedPreferences(ContextImpl.java:479) at android.content.ContextWrapper.getSharedPreferences(ContextWrapper.java:188) at com.segment.analytics.internal.Utils.getSegmentSharedPreferences(Utils.java:309) at com.segment.analytics.ValueMap$Cache.<init>(ValueMap.java:395) at com.segment.analytics.ProjectSettings$Cache.<init>(ProjectSettings.java:76) at com.segment.analytics.Analytics$Builder.build(Analytics.java:1378)
This happens when we schedule some work with WorkManager and it executes after device is booted but user hasn't entered credentials for the first time. Job execution can not be moved to a later stage, and we still need to send analytics.