airbnb/lottie-android · error · IllegalStateException

Missing values for keyframe.

Error message

Missing values for keyframe.

What it means

Thrown by IntegerKeyframeAnimation#getIntValue when a keyframe's startValue is null. Unlike the color/float variants, this animation tolerates a null endValue by falling back to the start value; only a null startValue is fatal because there is no baseline integer to interpolate from.

Source

Thrown at lottie/src/main/java/com/airbnb/lottie/animation/keyframe/IntegerKeyframeAnimation.java:24

import java.util.List;

public class IntegerKeyframeAnimation extends KeyframeAnimation<Integer> {

  public IntegerKeyframeAnimation(List<Keyframe<Integer>> keyframes) {
    super(keyframes);
  }

  @Override
  Integer getValue(Keyframe<Integer> keyframe, float keyframeProgress) {
    return getIntValue(keyframe, keyframeProgress);
  }

  /**
   * Optimization to avoid autoboxing.
   */
  int getIntValue(Keyframe<Integer> keyframe, float keyframeProgress) {
    if (keyframe.startValue == null) {
      throw new IllegalStateException("Missing values for keyframe.");
    }

    int endValue = keyframe.endValue == null ? keyframe.getStartValueInt() : keyframe.getEndValueInt();

    if (valueCallback != null) {
      //noinspection ConstantConditions
      Integer value = valueCallback.getValueInternal(keyframe.startFrame, keyframe.endFrame,
          keyframe.startValue, endValue,
          keyframeProgress, getLinearCurrentKeyframeProgress(), getProgress());
      if (value != null) {
        return value;
      }
    }

    return MiscUtils.lerp(keyframe.getStartValueInt(), endValue, keyframeProgress);
  }

  /**

View on GitHub (pinned to 05ea92e903)

Solutions

  1. Inspect the JSON keyframe and ensure a start integer value ("s") is present.
  2. Re-export the animation.
  3. Align lottie-android with the file's schema.
  4. Remove or simplify the affected property's keyframes.
Defensive patterns

Strategy: try-catch

Try / catch

lottieAnimationView.setFailureListener(t -> {
  if (t instanceof IllegalStateException && "Missing values for keyframe.".equals(t.getMessage())) {
    Log.w(TAG, "integer keyframe missing start value", t);
  } else throw new RuntimeException(t);
});

Prevention

When it happens

Trigger: Evaluating an integer keyframe whose startValue ("s") is absent/null in the JSON while the end value may or may not be present. The fallback endValue = endValue != null ? end : start cannot recover because start itself is null.

Common situations: Malformed keyframe in the JSON missing its start integer; export bug; schema incompatibility between the file and the library version.

Related errors


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