microg/GmsCore · critical · IllegalStateException

Unable to find dynamic class com.google.android.gms.maps.int

Error message

Unable to find dynamic class com.google.android.gms.maps.internal.CreatorImpl

What it means

MapsContextLoader.getCreator() loads com.google.android.gms.maps.internal.CreatorImpl from the (resolved) Google Play services / microG maps context via reflection and wraps it as ICreator. When Class.forName-equivalent loadClass fails with ClassNotFoundException, the loader rethrows IllegalStateException with this message. It means the maps provider package is not available or does not export that class on this device/runtime.

Source

Thrown at play-services-maps/src/main/java/org/microg/gms/maps/MapsContextLoader.java:74

                    mapsContext = GooglePlayServicesUtil.getRemoteContext(context);
                }
            }
            MapsContextLoader.mapsContext = mapsContext;
        }
        return mapsContext;
    }

    public static ICreator getCreator(Context context, @Nullable MapsInitializer.Renderer preferredRenderer) {
        Log.d(TAG, "preferredRenderer: " + preferredRenderer);
        if (creator == null) {
            Log.d(TAG, "Making Creator dynamically");
            try {
                Context mapsContext = getMapsContext(context, preferredRenderer);
                Class<?> clazz = mapsContext.getClassLoader().loadClass("com.google.android.gms.maps.internal.CreatorImpl");
                creator = ICreator.Stub.asInterface((IBinder) clazz.newInstance());
                creator.initV2(ObjectWrapper.wrap(mapsContext.getResources()), Constants.GMS_VERSION_CODE);
            } catch (ClassNotFoundException e) {
                throw new IllegalStateException("Unable to find dynamic class com.google.android.gms.maps.internal.CreatorImpl");
            } catch (IllegalAccessException e) {
                throw new IllegalStateException("Unable to call the default constructor of com.google.android.gms.maps.internal.CreatorImpl");
            } catch (InstantiationException e) {
                throw new IllegalStateException("Unable to instantiate the dynamic class com.google.android.gms.maps.internal.CreatorImpl");
            } catch (RemoteException e) {
                throw new RuntimeRemoteException(e);
            }
        }
        return creator;
    }
}

View on GitHub (pinned to 157c9d86ac)

Solutions

  1. Install or update microG GmsCore (or Google Play services) with maps support on the device.
  2. Verify the maps context resolves: ensure the companion/provider package for com.google.android.gms.maps is present and enabled.
  3. Update the play-services-maps client library and microG together so GMS_VERSION_CODE matches the provider.
  4. Catch IllegalStateException around map init and degrade gracefully (e.g. show a fallback view) rather than crashing the app.
  5. If self-hosting microG, build it with the maps module included.

Example fix

// before
MapView mapView = new MapView(context, options);
mapView.onCreate(null); // IllegalStateException if CreatorImpl missing
// after
try {
    mapView.onCreate(null);
} catch (IllegalStateException e) {
    showMapUnavailableFallback(); // e.g. prompt user to install/update microG
}
Defensive patterns

Strategy: try-catch

Validate before calling

// best-effort pre-check that a maps provider package exists
public static boolean mapsProviderLikelyAvailable(Context ctx) {
    try {
        ctx.createPackageContext("com.google.android.gms", Context.CONTEXT_INCLUDE_CODE);
        return true;
    } catch (Exception e) {
        return false;
    }
}

Try / catch

try {
    mapView.onCreate(savedInstanceState);
} catch (IllegalStateException e) {
    if (e.getMessage() != null && e.getMessage().contains("dynamic class")) {
        promptUserToInstallOrUpdateMicrog();
    } else {
        throw e;
    }
}

Prevention

When it happens

Trigger: First map initialization (MapView.onCreate / MapFragment) when the installed GmsCore/microG build lacks the maps module, the maps context cannot supply CreatorImpl, or a version mismatch removed the class.

Common situations: Device without Google Play services or with an outdated/incompatible microG build, microG without the maps add-on module, stripped/fooded GmsCore distributions, or a GMS_VERSION_CODE mismatch against an old provider.

Related errors


AI-assisted analysis of microg/GmsCore@157c9d86ac (2026-09-06). Data as JSON: /api/errors/d0b857b4bbab15f0. Report an issue: GitHub.