microg/GmsCore · error · IllegalStateException
Value is not a int.
Error message
Value is not a int.
What it means
Format guard in fitness Value.asInt: the Value's format is not FORMAT_INT32, so Float.floatToRawIntBits on the stored value would be meaningless. It fires when the accessor does not match the field's data format.
Source
Thrown at play-services-fitness/src/main/java/com/google/android/gms/fitness/data/Value.java:96
}
/**
* Returns the value of this object as a float.
*
* @throws IllegalStateException If this {@link Value} does not correspond to a {@link com.google.android.gms.fitness.data.Field#FORMAT_FLOAT}
*/
public float asFloat() {
if (format != FORMAT_FLOAT) throw new IllegalStateException("Value is not a float.");
return value;
}
/**
* Returns the value of this object as a int.
*
* @throws IllegalStateException If this {@link Value} does not correspond to a {@link com.google.android.gms.fitness.data.Field#FORMAT_INT32}
*/
public int asInt() {
if (format != FORMAT_INT32) throw new IllegalStateException("Value is not a int.");
return Float.floatToRawIntBits(this.value);
}
/**
* Returns the value of this object as a string.
*
* @throws IllegalStateException If this {@link Value} does not correspond to a {@link com.google.android.gms.fitness.data.Field#FORMAT_STRING}
*/
@NonNull
public String asString() {
if (format != FORMAT_STRING) throw new IllegalStateException("Value is not a string.");
if (stringValue == null) return "";
return stringValue;
}
/**
* Clears any value currently associated with the given {@code key} in the map. This method can be used only on map values.
*View on GitHub (pinned to 157c9d86ac)
Solutions
- Verify getFormat() == Field.FORMAT_INT32 before calling asInt()
- Read the value with asFloat()/asString() according to the actual format
Defensive patterns
Strategy: type-guard
When it happens
Trigger: Thrown at play-services-fitness/src/main/java/com/google/android/gms/fitness/data/Value.java:96 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/30b5293edaa65790.
Report an issue: GitHub.