{"record":{"id":"e0e0e3930f9d0872","repo":"airbnb/lottie-android","slug":"unknown-trim-path-type","errorCode":null,"errorMessage":"Unknown trim path type {}","messagePattern":"Unknown trim path type (.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"lottie/src/main/java/com/airbnb/lottie/model/content/ShapeTrimPath.java","lineNumber":23,"sourceCode":"import com.airbnb.lottie.animation.content.Content;\nimport com.airbnb.lottie.animation.content.TrimPathContent;\nimport com.airbnb.lottie.model.animatable.AnimatableFloatValue;\nimport com.airbnb.lottie.model.layer.BaseLayer;\n\npublic class ShapeTrimPath implements ContentModel {\n\n  public enum Type {\n    SIMULTANEOUSLY,\n    INDIVIDUALLY;\n\n    public static Type forId(int id) {\n      switch (id) {\n        case 1:\n          return SIMULTANEOUSLY;\n        case 2:\n          return INDIVIDUALLY;\n        default:\n          throw new IllegalArgumentException(\"Unknown trim path type \" + id);\n      }\n    }\n  }\n\n  private final String name;\n  private final Type type;\n  private final AnimatableFloatValue start;\n  private final AnimatableFloatValue end;\n  private final AnimatableFloatValue offset;\n  private final boolean hidden;\n\n  public ShapeTrimPath(String name, Type type, AnimatableFloatValue start,\n      AnimatableFloatValue end, AnimatableFloatValue offset, boolean hidden) {\n    this.name = name;\n    this.type = type;\n    this.start = start;\n    this.end = end;\n    this.offset = offset;","sourceCodeStart":5,"sourceCodeEnd":41,"githubUrl":"https://github.com/airbnb/lottie-android/blob/05ea92e90381eb8a8ae06855ea2b74f322bebbec/lottie/src/main/java/com/airbnb/lottie/model/content/ShapeTrimPath.java#L5-L41","documentation":"ShapeTrimPath.Type.forId(int) maps integer IDs from the Lottie JSON to the trim-path mode enum. Only ID 1 (SIMULTANEOUSLY) and ID 2 (INDIVIDUALLY) are recognized. Any other integer triggers IllegalArgumentException. This occurs during JSON parsing when the 'm' (trim mode) field of a trim-path shape layer contains an unrecognized value.","triggerScenarios":"The Lottie JSON contains a shape trim path ('ty': 'tm') whose mode field ('m') is set to a value other than 1 or 2. This happens with animations exported from non-standard tools, hand-edited JSON, or future Lottie spec versions that introduce new trim modes not yet supported by this library version.","commonSituations":"Using a Lottie animation exported from a newer version of Bodymovin/After Effects that added a new trim path mode; manually editing the JSON and mistyping the mode value; loading an animation that targets a newer Lottie spec than the library version supports.","solutions":["Inspect the Lottie JSON and locate the trim path objects ('ty': 'tm'); verify their 'm' field is 1 or 2. Correct invalid values.","Upgrade the Lottie library to a version that supports the trim mode used by your animation file.","If the mode is genuinely new, re-export from After Effects using only standard trim path settings, or remove the trim path modifier from the animation."],"exampleFix":"// before — in the Lottie JSON\n{\"ty\":\"tm\",\"m\":3,\"s\":{\"a\":0,\"k\":0},\"e\":{\"a\":0,\"k\":100}}\n\n// after — use a valid mode (1 = simultaneously, 2 = individually)\n{\"ty\":\"tm\",\"m\":1,\"s\":{\"a\":0,\"k\":0},\"e\":{\"a\":0,\"k\":100}}","handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":"// Wrap LottieComposition.fromJsonSync / fromInputStream\ntry {\n    LottieResult<LottieComposition> result = LottieCompositionFactory.fromAsset(context, \"anim.json\");\n    if (result.getValue() == null) {\n        Throwable t = result.getException();\n        // log and show fallback\n    }\n} catch (IllegalArgumentException e) {\n    // unknown enum value in animation JSON\n}","preventionTips":["Validate Lottie JSON with LottieFiles validator before bundling.","Keep the Lottie library version current to support the latest spec enum values.","Re-export animations from After Effects using only standard trim path modes."],"tags":["lottie","trim-path","enum","json-parsing","illegal-argument"],"backgroundTag":null,"analyzedSha":"05ea92e90381eb8a8ae06855ea2b74f322bebbec","analyzedAt":"2026-08-14T00:51:35.636Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}