airbnb/lottie-android · error · IllegalStateException
Missing values for keyframe.
Error message
Missing values for keyframe.
What it means
Thrown by FloatKeyframeAnimation#getFloatValue when a keyframe's startValue or endValue is null. Float (e.g. opacity, rotation) interpolation needs two numeric endpoints; a null endpoint means the keyframe data is missing a value.
Source
Thrown at lottie/src/main/java/com/airbnb/lottie/animation/keyframe/FloatKeyframeAnimation.java:23
import java.util.List;
public class FloatKeyframeAnimation extends KeyframeAnimation<Float> {
public FloatKeyframeAnimation(List<Keyframe<Float>> keyframes) {
super(keyframes);
}
@Override Float getValue(Keyframe<Float> keyframe, float keyframeProgress) {
return getFloatValue(keyframe, keyframeProgress);
}
/**
* Optimization to avoid autoboxing.
*/
float getFloatValue(Keyframe<Float> keyframe, float keyframeProgress) {
if (keyframe.startValue == null || keyframe.endValue == null) {
throw new IllegalStateException("Missing values for keyframe.");
}
if (valueCallback != null) {
//noinspection ConstantConditions
Float value = valueCallback.getValueInternal(keyframe.startFrame, keyframe.endFrame,
keyframe.startValue, keyframe.endValue,
keyframeProgress, getLinearCurrentKeyframeProgress(), getProgress());
if (value != null) {
return value;
}
}
return MiscUtils.lerp(keyframe.getStartValueFloat(), keyframe.getEndValueFloat(), keyframeProgress);
}
/**
* Optimization to avoid autoboxing.
*/View on GitHub (pinned to 05ea92e903)
Solutions
- Inspect the JSON for the offending float keyframe and confirm both "s" and "e" numeric values are present.
- Re-export the animation from After Effects.
- Align the lottie-android version with the file's feature set.
- Simplify the animated property to eliminate the malformed keyframe.
Defensive patterns
Strategy: try-catch
Try / catch
lottieAnimationView.setFailureListener(t -> {
if (t instanceof IllegalStateException && "Missing values for keyframe.".equals(t.getMessage())) {
Log.w(TAG, "malformed float keyframe", t);
} else throw new RuntimeException(t);
}); Prevention
- Inspect the JSON for float keyframes missing "s" or "e".
- Re-export the animation.
- Keep lottie-android aligned with the file's schema version.
When it happens
Trigger: Evaluating a float keyframe whose "s" or "e" value was not present or not parseable as a number; a keyframe object missing the end value field. The valueCallback branch is only entered after the null check, so a missing value throws before a callback could compensate.
Common situations: Truncated or hand-edited Lottie JSON; an export glitch producing a keyframe without an end value; schema mismatch between the file and the library.
Related errors
- Missing values for keyframe.
- Missing values for keyframe.
- Missing values for keyframe.
- Missing values for keyframe.
- This animation does not support split dimensions!
AI-assisted analysis of airbnb/lottie-android@05ea92e903 (2026-08-14).
Data as JSON: /api/errors/582e7d52ca822a90.
Report an issue: GitHub.