airbnb/lottie-android · error · IllegalArgumentException
Unknown point starts with {}
Error message
Unknown point starts with {} What it means
JsonUtils.jsonToPoint() parses a 2D point from the JSON stream. It handles three token types: NUMBER (bare x,y pair), BEGIN_ARRAY ([x,y]), and BEGIN_OBJECT ({x:...,y:...}). Any other leading token throws IllegalArgumentException. This fires during Lottie JSON parsing when a point field (vertex, in-tangent, out-tangent, position, anchor point) starts with unexpected JSON structure.
Source
Thrown at lottie/src/main/java/com/airbnb/lottie/parser/JsonUtils.java:55
while (reader.peek() == JsonReader.Token.BEGIN_ARRAY) {
reader.beginArray();
points.add(jsonToPoint(reader, scale));
reader.endArray();
}
reader.endArray();
return points;
}
static PointF jsonToPoint(JsonReader reader, float scale) throws IOException {
switch (reader.peek()) {
case NUMBER:
return jsonNumbersToPoint(reader, scale);
case BEGIN_ARRAY:
return jsonArrayToPoint(reader, scale);
case BEGIN_OBJECT:
return jsonObjectToPoint(reader, scale);
default:
throw new IllegalArgumentException("Unknown point starts with " + reader.peek());
}
}
private static PointF jsonNumbersToPoint(JsonReader reader, float scale) throws IOException {
float x = (float) reader.nextDouble();
float y = (float) reader.nextDouble();
while (reader.hasNext()) {
reader.skipValue();
}
return new PointF(x * scale, y * scale);
}
private static PointF jsonArrayToPoint(JsonReader reader, float scale) throws IOException {
float x;
float y;
reader.beginArray();
x = (float) reader.nextDouble();
y = (float) reader.nextDouble();View on GitHub (pinned to 05ea92e903)
Solutions
- Validate the Lottie JSON with a JSON linter and Lottie validator (e.g., lottiefiles.com validator) before loading.
- Locate the point field in the JSON where parsing fails (use the path/line info from the exception) and fix the malformed coordinate data.
- If the file is from a third party, re-download or re-export it to eliminate corruption.
Defensive patterns
Strategy: validation
Validate before calling
// Pre-validate the JSON is well-formed before loading into Lottie
try (JsonReader reader = JsonReader.of(source)) {
// quick structural validation pass
} catch (Exception e) {
// JSON is malformed; do not pass to Lottie
} Try / catch
LottieTask<LottieComposition> task = LottieCompositionFactory.fromAsset(context, name);
task.addListener(result -> { /* success */ })
.addFailureListener(e -> { /* malformed JSON — show fallback */ }); Prevention
- Validate Lottie JSON files with a JSON linter and LottieFiles validator before shipping.
- Use LottieCompositionFactory async APIs (fromAsset/fromInputStream) which return LottieResult instead of throwing synchronously.
- Re-export animations from supported tool versions.
When it happens
Trigger: The Lottie JSON contains a point value that is neither a number, an array, nor an object — e.g., a string, boolean, or null where coordinates are expected. Also possible with truncated or corrupted JSON where the reader encounters an unexpected token after a structural error earlier in the stream.
Common situations: Corrupted or truncated Lottie animation file; animation exported by a non-standard tool that formats points differently; hand-edited JSON with syntax errors in coordinate sections.
Related errors
- Cannot convert json to point. Next token is {}
- Unknown value for token of type {}
- Unknown trim path type {}
- Shape data was missing information.
- {} at path {}
AI-assisted analysis of airbnb/lottie-android@05ea92e903 (2026-08-14).
Data as JSON: /api/errors/67281938f4a50de0.
Report an issue: GitHub.