{"record":{"id":"0d61c88f2bc267ed","repo":"airbnb/lottie-android","slug":"at-path","errorCode":null,"errorMessage":"{} at path {}","messagePattern":"(.+?) at path (.+?)","errorType":"exception","errorClass":"JsonEncodingException","httpStatus":null,"severity":"error","filePath":"lottie/src/main/java/com/airbnb/lottie/parser/moshi/JsonReader.java","lineNumber":251,"sourceCode":"\n  final void pushScope(int newTop) {\n    if (stackSize == scopes.length) {\n      if (stackSize == 256) {\n        throw new JsonDataException(\"Nesting too deep at \" + getPath());\n      }\n      scopes = Arrays.copyOf(scopes, scopes.length * 2);\n      pathNames = Arrays.copyOf(pathNames, pathNames.length * 2);\n      pathIndices = Arrays.copyOf(pathIndices, pathIndices.length * 2);\n    }\n    scopes[stackSize++] = newTop;\n  }\n\n  /**\n   * Throws a new IO exception with the given message and a context snippet\n   * with this reader's content.\n   */\n  final JsonEncodingException syntaxError(String message) throws JsonEncodingException {\n    throw new JsonEncodingException(message + \" at path \" + getPath());\n  }\n\n\n  /**\n   * Consumes the next token from the JSON stream and asserts that it is the beginning of a new\n   * array.\n   */\n  public abstract void beginArray() throws IOException;\n\n  /**\n   * Consumes the next token from the JSON stream and asserts that it is the\n   * end of the current array.\n   */\n  public abstract void endArray() throws IOException;\n\n  /**\n   * Consumes the next token from the JSON stream and asserts that it is the beginning of a new\n   * object.","sourceCodeStart":233,"sourceCodeEnd":269,"githubUrl":"https://github.com/airbnb/lottie-android/blob/05ea92e90381eb8a8ae06855ea2b74f322bebbec/lottie/src/main/java/com/airbnb/lottie/parser/moshi/JsonReader.java#L233-L269","documentation":"JsonReader.syntaxError(String) is a helper method that appends the current JSON path to a message and throws JsonEncodingException. It is called from many places in the JSON reader whenever the stream structure violates JSON syntax rules (unexpected tokens, malformed literals, etc.). The specific message passed to syntaxError() identifies the exact violation, and the path tells you where in the JSON document it occurred.","triggerScenarios":"Any structural JSON syntax violation encountered during parsing: malformed escape sequences, premature EOF, unexpected delimiters, invalid number literals, etc. The exact trigger depends on which call site invoked syntaxError().","commonSituations":"Corrupted or truncated Lottie JSON file; hand-edited JSON with syntax errors; incomplete file download; encoding issues (e.g., BOM characters, non-UTF-8 encoding).","solutions":["Use the path in the exception message to locate the error in the JSON file and fix the syntax violation.","Validate the JSON with a standard JSON parser/linter to identify structural errors.","Re-download or re-export the animation file to eliminate corruption or encoding issues."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"LottieTask<LottieComposition> task = LottieCompositionFactory.fromAsset(context, name);\ntask.addListener(result -> { /* success */ })\n     .addFailureListener(e -> {\n         if (e instanceof JsonEncodingException) {\n             // JSON syntax error — file is corrupted\n         }\n     });","preventionTips":["Validate Lottie JSON with a standard JSON linter before loading.","Use async LottieCompositionFactory APIs to handle parse failures gracefully.","Check file integrity (checksum, size) after download."],"tags":["lottie","json-parsing","syntax-error","malformed-json","json-encoding-exception"],"backgroundTag":null,"analyzedSha":"05ea92e90381eb8a8ae06855ea2b74f322bebbec","analyzedAt":"2026-08-14T00:51:35.636Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}