Issue
I'm wondering if it is possible to run a local unit test on method with a WorkManager. I've run a local unit test that connects to a method with a WorkManager and I get the following error.
java.lang.IllegalStateException: WorkManager is not initialized properly. You have explicitly disabled WorkManagerInitializer in your manifest, have not manually called WorkManager#initialize at this point, and your Application does not implement Configuration.Provider.
I can run an Intrustemented unit test with a method that has a WorkManager.
Solution
With WorkManager, you cannot run a local unit test on your host machine, you need to write an Integration Test that runs on the emulator or on an Android device.
There's documentation available on the WorkaManager Guide and this is also covered in a couple of codelabs:
Answered By - pfmaggi
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.