microg/GmsCore · error · NumberFormatException
Invalid Size: "
Error message
Invalid Size: "
What it means
Number-format failure in Size.parseSize: the input string has no valid 'x'/'*' separator or its numeric parts do not parse as integers. The offending string is quoted in the message; this is a malformed-input validation error.
Source
Thrown at play-services-base/src/main/java/com/google/android/gms/common/images/Size.java:95
/**
* Parses the specified string as a size value.
* <p>
* The ASCII characters {@code \}{@code u002a} ('*') and {@code \}{@code u0078} ('x') are recognized as separators between the width and height.
* <p>
* For any {@code Size s}: {@code Size.parseSize(s.toString()).equals(s)}. However, the method also handles sizes expressed in the following forms:
* <p>
* "width{@code x}height" or "width{@code *}height" => new Size(width, height), where width and height are string integers potentially containing a sign, such as "-10", "+7" or "5".
*
* @param string the string representation of a size value.
* @return the size value represented by {@code string}.
* @throws NumberFormatException if {@code string} cannot be parsed as a size value.
* @throws NullPointerException if {@code string} was null
*/
public static Size parseSize(String string) {
if (string == null) throw new NullPointerException("string must not be null");
int split = string.indexOf('*');
if (split < 0) split = string.indexOf('x');
if (split < 0) throw new NumberFormatException("Invalid Size: \"" + string + "\"");
return new Size(Integer.parseInt(string.substring(0, split)), Integer.parseInt(string.substring(split + 1)));
}
/**
* Return the size represented as a string with the format {@code "WxH"}
* @return string representation of the size
*/
@Override
public String toString() {
return width + "x" + height;
}
}
View on GitHub (pinned to 157c9d86ac)
Solutions
- Ensure the string is in 'widthxheight' or 'width*height' form with valid integers
- Validate/sanitize the string before parsing and fall back to a default Size on failure
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at play-services-base/src/main/java/com/google/android/gms/common/images/Size.java:95 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/5776920e7b754a19.
Report an issue: GitHub.