{"record":{"id":"be26eda3925c59bc","repo":"airbnb/lottie-android","slug":"expected-end-object-but-was-at-path","errorCode":null,"errorMessage":"Expected END_OBJECT but was {} at path {}","messagePattern":"Expected END_OBJECT but was (.+?) at path (.+?)","errorType":"exception","errorClass":"JsonDataException","httpStatus":null,"severity":"error","filePath":"lottie/src/main/java/com/airbnb/lottie/parser/moshi/JsonUtf8Reader.java","lineNumber":166,"sourceCode":"      peeked = PEEKED_NONE;\n    } else {\n      throw new JsonDataException(\"Expected BEGIN_OBJECT but was \" + peek()\n          + \" at path \" + getPath());\n    }\n  }\n\n  @Override public void endObject() throws IOException {\n    int p = peeked;\n    if (p == PEEKED_NONE) {\n      p = doPeek();\n    }\n    if (p == PEEKED_END_OBJECT) {\n      stackSize--;\n      pathNames[stackSize] = null; // Free the last path name so that it can be garbage collected!\n      pathIndices[stackSize - 1]++;\n      peeked = PEEKED_NONE;\n    } else {\n      throw new JsonDataException(\"Expected END_OBJECT but was \" + peek()\n          + \" at path \" + getPath());\n    }\n  }\n\n  @Override public boolean hasNext() throws IOException {\n    int p = peeked;\n    if (p == PEEKED_NONE) {\n      p = doPeek();\n    }\n    return p != PEEKED_END_OBJECT && p != PEEKED_END_ARRAY && p != PEEKED_EOF;\n  }\n\n  @Override public Token peek() throws IOException {\n    int p = peeked;\n    if (p == PEEKED_NONE) {\n      p = doPeek();\n    }\n","sourceCodeStart":148,"sourceCodeEnd":184,"githubUrl":"https://github.com/airbnb/lottie-android/blob/05ea92e90381eb8a8ae06855ea2b74f322bebbec/lottie/src/main/java/com/airbnb/lottie/parser/moshi/JsonUtf8Reader.java#L148-L184","documentation":"JsonUtf8Reader.endObject() peeks the next token and expects PEEKED_END_OBJECT ('}'). If it encounters a different token, it throws JsonDataException with the actual token and path. This fires when the parser finishes reading an object's properties but the JSON does not properly terminate the object with a closing brace.","triggerScenarios":"The parser expects '}' but finds a continuation token — a property name, value, or comma — indicating extra properties, a missing delimiter, or structural corruption within an object.","commonSituations":"Corrupted Lottie JSON with missing closing braces; hand-edited JSON with structural errors; truncated file where the parser reads past available data into an unexpected token.","solutions":["Use the exception path to locate the malformed object and ensure it is properly closed with '}'.","Validate the JSON structure with a linter.","Re-download or re-export the animation."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"LottieTask<LottieComposition> task = LottieCompositionFactory.fromAsset(context, name);\ntask.addListener(result -> { /* success */ })\n     .addFailureListener(e -> { /* JSON object structure error */ });","preventionTips":["Validate Lottie JSON with a JSON linter.","Use async APIs to handle parse failures gracefully.","Re-export or re-download corrupted animations."],"tags":["lottie","json-parsing","type-mismatch","object","json-data-exception"],"backgroundTag":null,"analyzedSha":"05ea92e90381eb8a8ae06855ea2b74f322bebbec","analyzedAt":"2026-08-14T00:51:35.636Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}