microg/GmsCore · error · IllegalStateException

Detector processor must first be set with setProcessor in or

Error message

Detector processor must first be set with setProcessor in order to receive detection results.

What it means

Detector.receiveFrame(Frame) is part of the pipeline and only forwards detections when a processor has been installed; calling it before setProcessor/setProcessorOrNull throws IllegalStateException with this message, indicating the detector pipeline was used out of order.

Source

Thrown at play-services-vision-common/src/main/java/com/google/android/gms/vision/Detector.java:55

     * <p>
     * If your code has added a processor, an indication of the detector operational state is also indicated with the {@link Detector.Detections#detectorIsOperational()} method. You can check this in your app as it processes detection results, and can convey this state to the user if appropriate.
     *
     * @return true if the detector is operational, false if the dependency download is in progress
     */
    public boolean isOperational() {
        return true;
    }

    /**
     * Pipeline method (see class level documentation above) for receiving frames for detection. Detection results are forwarded onto a processor that was previously registered with this class (see {@link #setProcessor(Detector.Processor)}).
     * <p>
     * Alternatively, if you are just looking to synchronously run the detector on a single frame, use {@link #detect(Frame)} instead.
     */
    public void receiveFrame(Frame frame) {
        Detections<T> detections = new Detections<>(detect(frame), frame.getMetadata().withRotationAppliedToSize(), isOperational());
        synchronized (processorLock) {
            if (processor == null) {
                throw new IllegalStateException("Detector processor must first be set with setProcessor in order to receive detection results.");
            } else {
                processor.receiveDetections(detections);
            }
        }
    }

    /**
     * Shuts down the detector, releasing any underlying resources.
     */
    public void release() {
        synchronized (processorLock) {
            if (processor != null) {
                processor.release();
                processor = null;
            }
        }
    }

View on GitHub (pinned to 157c9d86ac)

Solutions

  1. Call detector.setProcessor(...) before feeding frames via receiveFrame
  2. Release the processor with release() when done
Defensive patterns

Strategy: type-guard

When it happens

Trigger: Thrown at play-services-vision-common/src/main/java/com/google/android/gms/vision/Detector.java:55 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/3fce4b1ea7dc96ad. Report an issue: GitHub.