Fixed
Status Update
Comments
[Deleted User] <[Deleted User]> #3
Initialize WorkManager in Application.onCreate or via a ContentProvider may cause other error:
08-07 14:03:13.261 5869 5869 E AndroidRuntime: java.lang.RuntimeException: Unable to get provider androidx.work.impl.WorkManagerInitializer: java.lang.IllegalStateException: SharedPreferences in credential encrypted storage are not available until after user is unlocked
08-07 14:03:13.261 5869 5869 E AndroidRuntime: at android.app.ActivityThread.installProvider(ActivityThread.java:6366)
08-07 14:03:13.261 5869 5869 E AndroidRuntime: at android.app.ActivityThread.installContentProviders(ActivityThread.java:5910)
08-07 14:03:13.261 5869 5869 E AndroidRuntime: at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5818)
08-07 14:03:13.261 5869 5869 E AndroidRuntime: at android.app.ActivityThread.-wrap1(Unknown Source:0)
08-07 14:03:13.261 5869 5869 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1717)
08-07 14:03:13.261 5869 5869 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:106)
08-07 14:03:13.261 5869 5869 E AndroidRuntime: at android.os.Looper.loop(Looper.java:164)
08-07 14:03:13.261 5869 5869 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:6618)
08-07 14:03:13.261 5869 5869 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
08-07 14:03:13.261 5869 5869 E AndroidRuntime: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
08-07 14:03:13.261 5869 5869 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:810)
08-07 14:03:13.261 5869 5869 E AndroidRuntime: Caused by: java.lang.IllegalStateException: SharedPreferences in credential encrypted storage are not available until after user is unlocked
08-07 14:03:13.261 5869 5869 E AndroidRuntime: at android.app.ContextImpl.getSharedPreferences(ContextImpl.java:387)
08-07 14:03:13.261 5869 5869 E AndroidRuntime: at android.app.ContextImpl.getSharedPreferences(ContextImpl.java:372)
08-07 14:03:13.261 5869 5869 E AndroidRuntime: at android.content.ContextWrapper.getSharedPreferences(ContextWrapper.java:167)
08-07 14:03:13.261 5869 5869 E AndroidRuntime: at androidx.work.impl.utils.IdGenerator.<init>(IdGenerator.java:47)
08-07 14:03:13.261 5869 5869 E AndroidRuntime: at androidx.work.impl.background.systemjob.SystemJobScheduler.<init>(SystemJobScheduler.java:69)
08-07 14:03:13.261 5869 5869 E AndroidRuntime: at androidx.work.impl.background.systemjob.SystemJobScheduler.<init>(SystemJobScheduler.java:55)
08-07 14:03:13.261 5869 5869 E AndroidRuntime: at androidx.work.impl.Schedulers.createBestAvailableBackgroundScheduler(Schedulers.java:114)
08-07 14:03:13.261 5869 5869 E AndroidRuntime: at androidx.work.impl.WorkManagerImpl.getSchedulers(WorkManagerImpl.java:228)
08-07 14:03:13.261 5869 5869 E AndroidRuntime: at androidx.work.impl.WorkManagerImpl.<init>(WorkManagerImpl.java:179)
08-07 14:03:13.261 5869 5869 E AndroidRuntime: at androidx.work.impl.WorkManagerImpl.<init>(WorkManagerImpl.java:151)
08-07 14:03:13.261 5869 5869 E AndroidRuntime: at androidx.work.impl.WorkManagerImpl.initialize(WorkManagerImpl.java:133)
08-07 14:03:13.261 5869 5869 E AndroidRuntime: at androidx.work.WorkManager.initialize(WorkManager.java:160)
08-07 14:03:13.261 5869 5869 E AndroidRuntime: at androidx.work.impl.WorkManagerInitializer.onCreate(WorkManagerInitializer.java:40)
08-07 14:03:13.261 5869 5869 E AndroidRuntime: at android.content.ContentProvider.attachInfo(ContentProvider.java:1928)
08-07 14:03:13.261 5869 5869 E AndroidRuntime: at android.content.ContentProvider.attachInfo(ContentProvider.java:1903)
08-07 14:03:13.261 5869 5869 E AndroidRuntime: at android.app.ActivityThread.installProvider(ActivityThread.java:6363)
08-07 14:03:13.261 5869 5869 E AndroidRuntime: ... 10 more
I will try other ways.
08-07 14:03:13.261 5869 5869 E AndroidRuntime: java.lang.RuntimeException: Unable to get provider androidx.work.impl.WorkManagerInitializer: java.lang.IllegalStateException: SharedPreferences in credential encrypted storage are not available until after user is unlocked
08-07 14:03:13.261 5869 5869 E AndroidRuntime: at android.app.ActivityThread.installProvider(ActivityThread.java:6366)
08-07 14:03:13.261 5869 5869 E AndroidRuntime: at android.app.ActivityThread.installContentProviders(ActivityThread.java:5910)
08-07 14:03:13.261 5869 5869 E AndroidRuntime: at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5818)
08-07 14:03:13.261 5869 5869 E AndroidRuntime: at android.app.ActivityThread.-wrap1(Unknown Source:0)
08-07 14:03:13.261 5869 5869 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1717)
08-07 14:03:13.261 5869 5869 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:106)
08-07 14:03:13.261 5869 5869 E AndroidRuntime: at android.os.Looper.loop(Looper.java:164)
08-07 14:03:13.261 5869 5869 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:6618)
08-07 14:03:13.261 5869 5869 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
08-07 14:03:13.261 5869 5869 E AndroidRuntime: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
08-07 14:03:13.261 5869 5869 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:810)
08-07 14:03:13.261 5869 5869 E AndroidRuntime: Caused by: java.lang.IllegalStateException: SharedPreferences in credential encrypted storage are not available until after user is unlocked
08-07 14:03:13.261 5869 5869 E AndroidRuntime: at android.app.ContextImpl.getSharedPreferences(ContextImpl.java:387)
08-07 14:03:13.261 5869 5869 E AndroidRuntime: at android.app.ContextImpl.getSharedPreferences(ContextImpl.java:372)
08-07 14:03:13.261 5869 5869 E AndroidRuntime: at android.content.ContextWrapper.getSharedPreferences(ContextWrapper.java:167)
08-07 14:03:13.261 5869 5869 E AndroidRuntime: at androidx.work.impl.utils.IdGenerator.<init>(IdGenerator.java:47)
08-07 14:03:13.261 5869 5869 E AndroidRuntime: at androidx.work.impl.background.systemjob.SystemJobScheduler.<init>(SystemJobScheduler.java:69)
08-07 14:03:13.261 5869 5869 E AndroidRuntime: at androidx.work.impl.background.systemjob.SystemJobScheduler.<init>(SystemJobScheduler.java:55)
08-07 14:03:13.261 5869 5869 E AndroidRuntime: at androidx.work.impl.Schedulers.createBestAvailableBackgroundScheduler(Schedulers.java:114)
08-07 14:03:13.261 5869 5869 E AndroidRuntime: at androidx.work.impl.WorkManagerImpl.getSchedulers(WorkManagerImpl.java:228)
08-07 14:03:13.261 5869 5869 E AndroidRuntime: at androidx.work.impl.WorkManagerImpl.<init>(WorkManagerImpl.java:179)
08-07 14:03:13.261 5869 5869 E AndroidRuntime: at androidx.work.impl.WorkManagerImpl.<init>(WorkManagerImpl.java:151)
08-07 14:03:13.261 5869 5869 E AndroidRuntime: at androidx.work.impl.WorkManagerImpl.initialize(WorkManagerImpl.java:133)
08-07 14:03:13.261 5869 5869 E AndroidRuntime: at androidx.work.WorkManager.initialize(WorkManager.java:160)
08-07 14:03:13.261 5869 5869 E AndroidRuntime: at androidx.work.impl.WorkManagerInitializer.onCreate(WorkManagerInitializer.java:40)
08-07 14:03:13.261 5869 5869 E AndroidRuntime: at android.content.ContentProvider.attachInfo(ContentProvider.java:1928)
08-07 14:03:13.261 5869 5869 E AndroidRuntime: at android.content.ContentProvider.attachInfo(ContentProvider.java:1903)
08-07 14:03:13.261 5869 5869 E AndroidRuntime: at android.app.ActivityThread.installProvider(ActivityThread.java:6363)
08-07 14:03:13.261 5869 5869 E AndroidRuntime: ... 10 more
I will try other ways.
su...@google.com <su...@google.com> #4
Thanks, we could reproduce the bug after some time.
A pending fix is athttps://review.source.android.com/24433
A pending fix is at
il...@google.com <il...@google.com> #5
Fix submitted to AOSP tree.
su...@google.com <su...@google.com>
ap...@google.com <ap...@google.com> #6
I see same problem with ubuntu 11.04 natty fresh install, as it was fresh i loaded sdk r12, with sun java 6 u26.
su...@google.com <su...@google.com> #7
Is there a workaround available till SDK R13 besides running at scale < 0.5 or >= 1.0?
[Deleted User] <[Deleted User]> #8
I also am seeing this problem with Ubuntu 11.04 and SDK 12.
ra...@google.com <ra...@google.com> #9
I'm also seeing this issue with LinuxMint 11 LXDE.
ma...@gmail.com <ma...@gmail.com> #10
Sorry for the inconvenience, where is file argb.h
so...@gmail.com <so...@gmail.com> #11
any workaround till r13 ?
so...@gmail.com <so...@gmail.com> #12
Same here with Ubuntu 11.04 (64 bits) and SDK 13...
The link given above to get the fix doesn't work for me :(
The link given above to get the fix doesn't work for me :(
Description
My app starts by receiving "android.intent.action.LOCKED_BOOT_COMPLETED", WorkManager initial before user unlocked.
It cause crash:
java.lang.IllegalStateException: SharedPreferences in credential encrypted storage are not available until after user is unlocked
Because WorkManager use context.applicationContext accessing data/data/package/xxxx.
I tried to disable WorkManagerInitializer in AndroidManifest.xml and initial WorkManager on my first activity.But it cause another crash:
08-16 11:02:07.441 E/AndroidRuntime(19740): java.lang.RuntimeException: Unable to create service androidx.work.impl.background.systemjob.SystemJobService: java.lang.IllegalStateException: WorkManager needs to be initialized via a ContentProvider#onCreate() or an Application#onCreate().
08-16 11:02:07.441 E/AndroidRuntime(19740): at android.app.ActivityThread.handleCreateService(ActivityThread.java:3415)
08-16 11:02:07.441 E/AndroidRuntime(19740): at android.app.ActivityThread.-wrap4(Unknown Source:0)
08-16 11:02:07.441 E/AndroidRuntime(19740): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1738)
08-16 11:02:07.441 E/AndroidRuntime(19740): at android.os.Handler.dispatchMessage(Handler.java:106)
08-16 11:02:07.441 E/AndroidRuntime(19740): at android.os.Looper.loop(Looper.java:164)
08-16 11:02:07.441 E/AndroidRuntime(19740): at android.app.ActivityThread.main(ActivityThread.java:6618)
08-16 11:02:07.441 E/AndroidRuntime(19740): at java.lang.reflect.Method.invoke(Native Method)
08-16 11:02:07.441 E/AndroidRuntime(19740): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
08-16 11:02:07.441 E/AndroidRuntime(19740): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:810)
08-16 11:02:07.441 E/AndroidRuntime(19740): Caused by: java.lang.IllegalStateException: WorkManager needs to be initialized via a ContentProvider#onCreate() or an Application#onCreate().
08-16 11:02:07.441 E/AndroidRuntime(19740): at androidx.work.impl.background.systemjob.SystemJobService.onCreate(SystemJobService.java:67)
08-16 11:02:07.441 E/AndroidRuntime(19740): at android.app.ActivityThread.handleCreateService(ActivityThread.java:3405)
08-16 11:02:07.441 E/AndroidRuntime(19740): ... 8 more