airbnb/lottie-android · error · UnsupportedOperationException

LottieAnimator does not support setStartDelay.

Error message

LottieAnimator does not support setStartDelay.

What it means

BaseLottieAnimator overrides ValueAnimator.setStartDelay(long) to unconditionally throw UnsupportedOperationException. Lottie animations are frame-driven by the composition — the concept of a start delay does not map to Lottie's timing model. The override exists to fail explicitly rather than silently accept and ignore the call.

Source

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

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);
  }

  public void removeUpdateListener(ValueAnimator.AnimatorUpdateListener listener) {
    updateListeners.remove(listener);
  }

View on GitHub (pinned to 05ea92e903)

Solutions

  1. For delayed playback, use Handler.postDelayed or coroutine delay before calling LottieAnimationView.playAnimation() instead of setStartDelay()
  2. If AnimatorSet triggers this, wrap the Lottie animation in a no-op ValueAnimator and sequence that instead, calling lottieAnimationView.playAnimation() in the no-op's onAnimationStart listener
  3. Do not pass LottieValueAnimator to AnimatorSet.play().after() — this will call setStartDelay internally

Example fix

// before: animator.setStartDelay(500);
// after:  // schedule playback externally
//         handler.postDelayed(() -> lottieAnimationView.playAnimation(), 500);

// For sequencing with AnimatorSet, use a proxy animator:
// ValueAnimator proxy = ValueAnimator.ofInt(0, 1);
// proxy.setDuration(0);
// proxy.addListener(new AnimatorListenerAdapter() {
//   @Override public void onAnimationStart(Animator a) {
//     lottieAnimationView.playAnimation();
//   }
// });
// AnimatorSet set = new AnimatorSet();
// set.play(proxy).after(otherAnimator);
Defensive patterns

Strategy: type-guard

Type guard

// Guard against calling setStartDelay on LottieAnimator
boolean isLottieAnimator(ValueAnimator animator) {
  return animator instanceof com.airbnb.lottie.utils.BaseLottieAnimator;
}

// Safe access:
void safeSetStartDelay(ValueAnimator animator, long delay) {
  if (animator instanceof com.airbnb.lottie.utils.BaseLottieAnimator) {
    throw new IllegalArgumentException("Use external scheduling for LottieAnimator delays");
  }
  animator.setStartDelay(delay);
}

Prevention

When it happens

Trigger: Calling setStartDelay(ms) on a LottieValueAnimator. This can happen via direct call, or through Android framework code like AnimatorSet.play().after() which internally calls setStartDelay() on the animator. The throw is at BaseLottieAnimator.java:22.

Common situations: Using AnimatorSet to sequence a Lottie animation after others — AnimatorSet internally calls setStartDelay() which triggers this. Treating LottieValueAnimator as a drop-in ValueAnimator replacement in existing animation code. Chaining animations with standard Android patterns. Code migrated from ObjectAnimator that relied on setStartDelay.

Related errors


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