microg/GmsCore · error · IllegalArgumentException

invalid type:

Error message

invalid type: 

What it means

Guard in Geofence.checkType: the geofence type value is not a recognized constant, so the geofence cannot be interpreted. The offending value is appended; used both at construction and when reading types back via createFromParcel/typeToString.

Source

Thrown at play-services-location/core/system-api/src/main/java/android/location/Geofence.java:87

    private static void checkRadius(float radius) {
        if (radius <= 0) {
            throw new IllegalArgumentException("invalid radius: " + radius);
        }
    }

    private static void checkLatLong(double latitude, double longitude) {
        if (latitude > 90.0 || latitude < -90.0) {
            throw new IllegalArgumentException("invalid latitude: " + latitude);
        }
        if (longitude > 180.0 || longitude < -180.0) {
            throw new IllegalArgumentException("invalid longitude: " + longitude);
        }
    }

    private static void checkType(int type) {
        if (type != TYPE_HORIZONTAL_CIRCLE) {
            throw new IllegalArgumentException("invalid type: " + type);
        }
    }

    public static final Parcelable.Creator<Geofence> CREATOR = new Parcelable.Creator<Geofence>() {
        @Override
        public Geofence createFromParcel(Parcel in) {
            int type = in.readInt();
            double latitude = in.readDouble();
            double longitude = in.readDouble();
            float radius = in.readFloat();
            checkType(type);
            return Geofence.createCircle(latitude, longitude, radius);
        }
        @Override
        public Geofence[] newArray(int size) {
            return new Geofence[size];
        }
    };

View on GitHub (pinned to 157c9d86ac)

Solutions

  1. Use only the recognized geofence type / transition constants (ENTER, EXIT, DWELL)
  2. Validate stored or received type values before building a Geofence
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at play-services-location/core/system-api/src/main/java/android/location/Geofence.java:87 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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