{"record":{"id":"bd2d089c4e70c6b1","repo":"airbnb/lottie-android","slug":"cannot-skip-unexpected-at","errorCode":null,"errorMessage":"Cannot skip unexpected {} at {}","messagePattern":"Cannot skip unexpected (.+?) at (.+?)","errorType":"exception","errorClass":"JsonDataException","httpStatus":null,"severity":"error","filePath":"lottie/src/main/java/com/airbnb/lottie/parser/moshi/JsonUtf8Reader.java","lineNumber":578,"sourceCode":"    // can restore the peek state in case we fail to find a match.\n    String lastPathName = pathNames[stackSize - 1];\n\n    String nextName = nextName();\n    result = findName(nextName, options);\n\n    if (result == -1) {\n      peeked = PEEKED_BUFFERED_NAME;\n      peekedString = nextName;\n      // We can't push the path further, make it seem like nothing happened.\n      pathNames[stackSize - 1] = lastPathName;\n    }\n\n    return result;\n  }\n\n  @Override public void skipName() throws IOException {\n    if (failOnUnknown) {\n      throw new JsonDataException(\"Cannot skip unexpected \" + peek() + \" at \" + getPath());\n    }\n    int p = peeked;\n    if (p == PEEKED_NONE) {\n      p = doPeek();\n    }\n    if (p == PEEKED_UNQUOTED_NAME) {\n      skipUnquotedValue();\n    } else if (p == PEEKED_DOUBLE_QUOTED_NAME) {\n      skipQuotedValue(DOUBLE_QUOTE_OR_SLASH);\n    } else if (p == PEEKED_SINGLE_QUOTED_NAME) {\n      skipQuotedValue(SINGLE_QUOTE_OR_SLASH);\n    } else if (p != PEEKED_BUFFERED_NAME) {\n      throw new JsonDataException(\"Expected a name but was \" + peek() + \" at path \" + getPath());\n    }\n    peeked = PEEKED_NONE;\n    pathNames[stackSize - 1] = \"null\";\n  }\n","sourceCodeStart":560,"sourceCodeEnd":596,"githubUrl":"https://github.com/airbnb/lottie-android/blob/05ea92e90381eb8a8ae06855ea2b74f322bebbec/lottie/src/main/java/com/airbnb/lottie/parser/moshi/JsonUtf8Reader.java#L560-L596","documentation":"JsonUtf8Reader.skipName() is called when the parser encounters a property name it doesn't recognize. If the JsonReader's failOnUnknown flag is true (strict mode), instead of skipping it throws JsonDataException, refusing to silently ignore unknown properties. This is a deliberate strict-validation behavior — the library is configured to fail on any unrecognized key in the Lottie JSON.","triggerScenarios":"The Lottie JSON contains a property name that this version of the Lottie library does not recognize, AND the JsonReader has been configured with failOnUnknown=true. This could be a newer Lottie spec field, a custom/extension field, or a typo in the JSON.","commonSituations":"Loading a Lottie animation that uses newer spec fields not supported by the current library version; strict-mode parsing configuration enabled; animation contains custom metadata fields that the parser doesn't expect.","solutions":["Upgrade the Lottie library to a version that recognizes the property.","If you control the animation file, remove the unknown property from the JSON.","If strict mode was explicitly enabled, disable failOnUnknown on the reader (note: the standard Lottie parser does not enable this by default)."],"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 JsonDataException && e.getMessage().contains(\"Cannot skip\")) {\n             // unknown property in strict mode\n         }\n     });","preventionTips":["Keep the Lottie library updated to support new spec fields.","If you control the animation JSON, remove custom/unknown properties.","The standard Lottie parser does not enable failOnUnknown by default, so this only triggers in custom configurations."],"tags":["lottie","json-parsing","unknown-property","strict-mode","json-data-exception"],"backgroundTag":null,"analyzedSha":"05ea92e90381eb8a8ae06855ea2b74f322bebbec","analyzedAt":"2026-08-14T00:51:35.636Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}