Remove default init when using both Default & Custom?

I’m getting the following error when I upgrade WorkManager from 2.2.0 to 2.3.0-rc01 during APK export:

C:\app: Error: Remove from your AndroidManifest.xml when using on-demand initialization. [RemoveWorkManagerInitializer]

According to the documentation, I should remove the provider from my AndroidManifest.xml to use on-demand initialization. I’m not sure why I didn’t get such an error in 2.2.0, as on-demand initialization is supported since 2.1.0.

My Application class is as follows:

public class MyApplication extends MultiDexApplication implements Configuration.Provider {
    private static MyApplication me;

    public void onCreate() {

        me = this;

    public static MyApplication instance() {
        return me;

    public Configuration getWorkManagerConfiguration() {
        return new Configuration.Builder()

I construct WorkManager as follows:

public static WorkManager getWorkManager() {
    MyApplication myApplication = MyApplication.instance();
    if (myApplication == null) {
        return WorkManager.getInstance();
    } else {
        return WorkManager.getInstance(myApplication);

Including the provider in my AndroidManifest.xml will eliminate the error during APK export. However, I’m not sure if this is the correct way to use on-demand initialization.

To resolve the error and use on-demand initialization with WorkManager 2.3.0-rc01, you should remove the provider from your AndroidManifest.xml.

Here’s the updated AndroidManifest.xml:

<manifest xmlns:android=""

    <!-- Other manifest entries -->

        <!-- Remove the following line -->
        <!-- <provider
            tools:node="remove" /> -->

By removing the provider entry, you will be using the on-demand initialization feature correctly, as described in the documentation.