microg/GmsCore · error · IllegalStateException
Missing image data. Call either setBitmap or setImageData t
Error message
Missing image data. Call either setBitmap or setImageData to specify the image
What it means
Thrown by Frame.Builder.build() when neither setBitmap() nor setImageData() was called on the builder. A Frame must wrap actual image pixels for vision detectors to process; this exception means the builder was used to set only metadata (id, rotation, etc.) and the frame was built without any image content, so there is nothing to analyze.
Source
Thrown at play-services-vision-common/src/main/java/com/google/android/gms/vision/Frame.java:87
public Frame.Metadata getMetadata() {
return metadata;
}
/**
* Builder for creating a frame instance.
* At a minimum, image information must be specified either through {@link #setBitmap(Bitmap)} or {@link #setImageData(ByteBuffer, int, int, int)}.
*/
public static class Builder {
private final Frame frame = new Frame();
/**
* Creates the frame instance.
*
* @throws IllegalStateException if the image data has not been set via {@link #setBitmap(Bitmap)} or {@link #setImageData(ByteBuffer, int, int, int)}.
*/
public Frame build() {
if (this.frame.bitmap == null && this.frame.imageData == null) {
throw new IllegalStateException("Missing image data. Call either setBitmap or setImageData to specify the image");
}
return frame;
}
/**
* Sets the image data for the frame from a supplied bitmap.
* <p>
* While this is a convenient way to specify certain images (e.g., images read from a file), note that a copy is required to extract pixel information for use in detectors -- this could mean extra GC overhead. Using {@link #setImageData(ByteBuffer, int, int, int)} is the preferred way to specify image data if you can handle the data in a supported byte format and reuse the byte buffer, since it does not require a making a copy.
*/
public Builder setBitmap(Bitmap bitmap) {
this.frame.bitmap = bitmap;
this.frame.metadata.width = bitmap.getWidth();
this.frame.metadata.height = bitmap.getHeight();
return this;
}
/**
* Sets the frame ID. A frame source such as a live video camera or a video player is expected to assign IDs in monotonically increasing order, to indicate the sequence that the frame appeared relative to other frames.View on GitHub (pinned to 157c9d86ac)
Solutions
- Call setBitmap(bitmap) or setImageData(buffer, width, height, format) before build()
- Track whether image data was supplied and skip building otherwise
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at play-services-vision-common/src/main/java/com/google/android/gms/vision/Frame.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/ebde096f581aca97.
Report an issue: GitHub.