With: implementation "androidx.work:work-runtime:2.3.4"
I'm trying to implement custom initialization to enable more verbose logging according to these instructions.
The first snippet has one line bad: return Configuration.Builder() needs to be return new Configuration.Builder().
I extended Application as shown like this:
class MyApplication extends Application implements Configuration.Provider {
@Override
public Configuration getWorkManagerConfiguration() {
return new Configuration.Builder()
.setMinimumLoggingLevel(android.util.Log.INFO)
.build();
}
}
I initiate the worker like this:
WorkManager.getInstance(getApplicationContext());
And yet even after all of that I get the application to crash with this complaint:
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.
Even though the instructions states:
You do not need to call WorkManager.initialize() yourself