microg/GmsCore · error · IllegalArgumentException
Null image data supplied
Error message
Null image data supplied
What it means
Argument guard in Frame.Builder.setImageData. The caller passed a null ByteBuffer as the image payload. A Frame holds a direct reference to the supplied buffer, and a null buffer would produce a frame with no backing pixels, so the builder rejects it immediately instead of failing later inside a detector.
Source
Thrown at play-services-vision-common/src/main/java/com/google/android/gms/vision/Frame.java:124
* <p>
* A {@link Detector.Processor} implementation may rely upon this sequence ID to detect frame sequence gaps, to compute velocity, etc.
*/
public Builder setId(int id) {
this.frame.metadata.id = id;
return this;
}
/**
* Sets the image data from the supplied byte buffer, size, and format.
*
* @param data contains image byte data according to the associated format.
* @param width
* @param height
* @param format one of {@link ImageFormat#NV16}, {@link ImageFormat#NV21}, or {@link ImageFormat#YV12}.
* @throws IllegalArgumentException if the supplied data is null, or an invalid image format was supplied.
*/
public Builder setImageData(ByteBuffer data, int width, int height, int format) {
if (data == null) throw new IllegalArgumentException("Null image data supplied");
if (data.capacity() < width * height) throw new IllegalArgumentException("Invalid image data size");
if (format != ImageFormat.NV16 && format != ImageFormat.NV21 && format != ImageFormat.YV12)
throw new IllegalArgumentException("Unsupported image format: " + format);
this.frame.imageData = data;
this.frame.metadata.width = width;
this.frame.metadata.height = height;
this.frame.metadata.format = format;
return this;
}
/**
* Sets the image rotation, indicating the rotation from the upright orientation.
* <p>
* Since the camera may deliver images that are rotated (e.g., if the user holds the device upside down), specifying the rotation with the image indicates how to make the image be upright, if necessary. Some detectors may rely upon rotating the image before attempting detection, whereas others may not. In preserving the original image from the camera along with this value, the detector may choose whether to make this correction (and to assume the associated cost).
* <p>
* However, note that the detector is expected to report detection position coordinates that are relative to the upright version of the image (whether or not the image was actually rotated by the detector). The {@link Detector} will always deliver frame metadata to the {@link Detector.Processor} that indicates the dimensions and orientation of an unrotated, upright frame.
*
* @param rotation one of {@link Frame#ROTATION_0}, {@link Frame#ROTATION_90}, {@link Frame#ROTATION_180}, {@link Frame#ROTATION_270}. Has the same meaning as {@link Display#getRotation()}.View on GitHub (pinned to 157c9d86ac)
Solutions
- Pass a non-null ByteBuffer containing the image bytes
- Guard camera/image callbacks for null data before building a frame
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at play-services-vision-common/src/main/java/com/google/android/gms/vision/Frame.java:124 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/7a1e04940812c35b.
Report an issue: GitHub.