airbnb/lottie-android · error · IllegalArgumentException

Shape data was missing information.

Error message

Shape data was missing information.

What it means

ShapeDataParser parses a cubic-bezier shape vertex ('ks' in a shape path) from the JSON, reading three required arrays: points ('v'), in-tangents ('i'), and out-tangents ('o'). After reading the object, if any of these three arrays is still null (i.e., the JSON object was missing the field), it throws IllegalArgumentException. An empty points array is valid (returns an empty shape); only missing fields trigger this.

Source

Thrown at lottie/src/main/java/com/airbnb/lottie/parser/ShapeDataParser.java:68

          inTangents = JsonUtils.jsonToPoints(reader, scale);
          break;
        case 3:
          outTangents = JsonUtils.jsonToPoints(reader, scale);
          break;
        default:
          reader.skipName();
          reader.skipValue();
      }
    }

    reader.endObject();

    if (reader.peek() == JsonReader.Token.END_ARRAY) {
      reader.endArray();
    }

    if (pointsArray == null || inTangents == null || outTangents == null) {
      throw new IllegalArgumentException("Shape data was missing information.");
    }

    if (pointsArray.isEmpty()) {
      return new ShapeData(new PointF(), false, Collections.<CubicCurveData>emptyList());
    }

    int length = pointsArray.size();
    PointF vertex = pointsArray.get(0);
    PointF initialPoint = vertex;
    List<CubicCurveData> curves = new ArrayList<>(length);

    for (int i = 1; i < length; i++) {
      vertex = pointsArray.get(i);
      PointF previousVertex = pointsArray.get(i - 1);
      PointF cp1 = outTangents.get(i - 1);
      PointF cp2 = inTangents.get(i);
      PointF shapeCp1 = MiscUtils.addPoints(previousVertex, cp1);
      PointF shapeCp2 = MiscUtils.addPoints(vertex, cp2);

View on GitHub (pinned to 05ea92e903)

Solutions

  1. Inspect the shape path object at the error location and ensure all three keys 'v', 'i', and 'o' are present with equal-length arrays.
  2. Re-export the animation from After Effects to regenerate complete shape data.
  3. If you control the JSON generation, validate that every shape path includes vertices, in-tangents, and out-tangents arrays.

Example fix

// before — missing 'o' (out-tangents)
{"ty":"sh","ks":{"a":0,"k":{"v":[[0,0],[100,0]],"i":[[0,0],[0,0]]}}}

// after — all three arrays present
{"ty":"sh","ks":{"a":0,"k":{"v":[[0,0],[100,0]],"i":[[0,0],[0,0]],"o":[[0,0],[0,0]]}}}
Defensive patterns

Strategy: validation

Try / catch

LottieTask<LottieComposition> task = LottieCompositionFactory.fromAsset(context, name);
task.addListener(result -> { /* success */ })
     .addFailureListener(e -> { /* missing shape data */ });

Prevention

When it happens

Trigger: A shape path object in the Lottie JSON is missing one or more of the required keys 'v' (vertices), 'i' (in-tangents), or 'o' (out-tangents). This can also occur if a key name is misspelled or if the JSON structure is corrupted so the parser's switch statement never matches the expected names.

Common situations: Hand-edited Lottie JSON with removed or renamed vertex/tangent arrays; corrupted animation file; animation exported by a tool that omits tangent data for certain shape types.

Related errors


AI-assisted analysis of airbnb/lottie-android@05ea92e903 (2026-08-14). Data as JSON: /api/errors/37d461b8b97acd76. Report an issue: GitHub.