{"record":{"id":"82ad8ff20176a4b3","repo":"airbnb/lottie-android","slug":"cannot-convert-json-to-point-next-token-is","errorCode":null,"errorMessage":"Cannot convert json to point. Next token is {}","messagePattern":"Cannot convert json to point\\. Next token is (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"lottie/src/main/java/com/airbnb/lottie/parser/PointFParser.java","lineNumber":32,"sourceCode":"\n  @Override\n  public PointF parse(JsonReader reader, float scale) throws IOException {\n    JsonReader.Token token = reader.peek();\n    if (token == JsonReader.Token.BEGIN_ARRAY) {\n      return JsonUtils.jsonToPoint(reader, scale);\n    } else if (token == JsonReader.Token.BEGIN_OBJECT) {\n      return JsonUtils.jsonToPoint(reader, scale);\n    } else if (token == JsonReader.Token.NUMBER) {\n      // This is the case where the static value for a property is an array of numbers.\n      // We begin the array to see if we have an array of keyframes but it's just an array\n      // of static numbers instead.\n      PointF point = new PointF((float) reader.nextDouble() * scale, (float) reader.nextDouble() * scale);\n      while (reader.hasNext()) {\n        reader.skipValue();\n      }\n      return point;\n    } else {\n      throw new IllegalArgumentException(\"Cannot convert json to point. Next token is \" + token);\n    }\n  }\n}\n","sourceCodeStart":14,"sourceCodeEnd":36,"githubUrl":"https://github.com/airbnb/lottie-android/blob/05ea92e90381eb8a8ae06855ea2b74f322bebbec/lottie/src/main/java/com/airbnb/lottie/parser/PointFParser.java#L14-L36","documentation":"PointFParser.parse() reads a PointF from the JSON stream, handling BEGIN_ARRAY, BEGIN_OBJECT, and NUMBER tokens. If the next token is none of these (e.g., STRING, BOOLEAN, NULL), it throws IllegalArgumentException. This is the higher-level entry point that delegates to JsonUtils.jsonToPoint() for array/object cases and handles bare-number pairs inline.","triggerScenarios":"A position/anchor/vertex field in the Lottie JSON begins with an unexpected token that is not an array, object, or number. Functionally the same class of error as errors [23] and [24] but reached through the PointFParser dispatch path.","commonSituations":"Corrupted Lottie JSON; non-standard export tool producing unexpected token types for coordinate fields; truncation causing the reader to land on a wrong token.","solutions":["Validate the animation JSON with LottieFiles validator.","Use the exception's path information to locate the malformed PointF field and fix its structure to [x, y], {\"x\":..,\"y\":..}, or bare x y.","Re-export the animation from its source (After Effects / LottieFiles)."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":"LottieTask<LottieComposition> task = LottieCompositionFactory.fromAsset(context, name);\ntask.addListener(result -> { /* success */ })\n     .addFailureListener(e -> { /* malformed JSON */ });","preventionTips":["Validate Lottie JSON structure with LottieFiles validator.","Use async LottieCompositionFactory APIs for graceful error handling.","Re-export or re-download the animation if corrupted."],"tags":["lottie","json-parsing","point","malformed-json","illegal-argument"],"backgroundTag":null,"analyzedSha":"05ea92e90381eb8a8ae06855ea2b74f322bebbec","analyzedAt":"2026-08-14T00:51:35.636Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}