airbnb/lottie-android · error · UnsupportedOperationException

LottieAnimator does not support getStartDelay.

Error message

LottieAnimator does not support getStartDelay.

What it means

BaseLottieAnimator overrides ValueAnimator.getStartDelay() to unconditionally throw UnsupportedOperationException. Lottie animations derive their timing entirely from the LottieComposition's frame rate and frame range — start delay is not a concept that applies. The method is overridden only to fail loudly rather than silently return a meaningless value.

Source

Thrown at lottie/src/main/java/com/airbnb/lottie/utils/BaseLottieAnimator.java:18

package com.airbnb.lottie.utils;

import android.animation.Animator;
import android.animation.TimeInterpolator;
import android.animation.ValueAnimator;
import android.os.Build;

import java.util.Set;
import java.util.concurrent.CopyOnWriteArraySet;

public abstract class BaseLottieAnimator extends ValueAnimator {
  private final Set<ValueAnimator.AnimatorUpdateListener> updateListeners = new CopyOnWriteArraySet<>();
  private final Set<AnimatorListener> listeners = new CopyOnWriteArraySet<>();
  private final Set<Animator.AnimatorPauseListener> pauseListeners = new CopyOnWriteArraySet<>();


  @Override public long getStartDelay() {
    throw new UnsupportedOperationException("LottieAnimator does not support getStartDelay.");
  }

  @Override public void setStartDelay(long startDelay) {
    throw new UnsupportedOperationException("LottieAnimator does not support setStartDelay.");
  }

  @Override public ValueAnimator setDuration(long duration) {
    throw new UnsupportedOperationException("LottieAnimator does not support setDuration.");
  }

  @Override public void setInterpolator(TimeInterpolator value) {
    throw new UnsupportedOperationException("LottieAnimator does not support setInterpolator.");
  }

  public void addUpdateListener(ValueAnimator.AnimatorUpdateListener listener) {
    updateListeners.add(listener);
  }

View on GitHub (pinned to 05ea92e903)

Solutions

  1. Remove the getStartDelay() call — Lottie does not support start delays; use external scheduling (Handler.postDelayed, coroutine delay, etc.) if you need delayed playback
  2. If you need delayed start, wrap LottieAnimationView.playAnimation() in a Handler.postDelayed or use an AnimatorSet with a placeholder delay animator
  3. If using an animation orchestration framework, exclude LottieAnimator from generic property introspection or provide a custom adapter

Example fix

// before: animator.getStartDelay();
// after:  // LottieAnimator doesn't support start delay.
//         // To delay playback, use external scheduling:
//         handler.postDelayed(() -> lottieAnimationView.playAnimation(), delayMs);

// Or with AnimatorSet for framework compatibility:
// AnimatorSet set = new AnimatorSet();
// set.play(lottieAnimator).after(delayMs); // but do NOT call getStartDelay on lottieAnimator
Defensive patterns

Strategy: type-guard

Type guard

// Guard against calling getStartDelay on LottieAnimator
boolean isLottieAnimator(ValueAnimator animator) {
  return animator instanceof BaseLottieAnimator;
}

// Safe access:
long safeGetStartDelay(ValueAnimator animator) {
  if (animator instanceof BaseLottieAnimator) {
    return 0; // LottieAnimator doesn't support start delay
  }
  return animator.getStartDelay();
}

Prevention

When it happens

Trigger: Calling getStartDelay() on a LottieValueAnimator (which extends BaseLottieAnimator). This can happen directly via animator.getStartDelay(), or indirectly through Android framework code or helper utilities that query ValueAnimator properties generically. The throw is at BaseLottieAnimator.java:18.

Common situations: A developer treats LottieValueAnimator as a standard ValueAnimator and calls getStartDelay(). Android testing utilities or animation orchestration frameworks that introspect all animator properties. Copying code from a standard ValueAnimator usage pattern. IDE auto-complete suggesting getStartDelay().

Related errors


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