{"record":{"id":"7b4c1f820a7cbb6e","repo":"airbnb/lottie-android","slug":"lottieanimator-does-not-support-getstartdelay","errorCode":null,"errorMessage":"LottieAnimator does not support getStartDelay.","messagePattern":"LottieAnimator does not support getStartDelay\\.","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"lottie/src/main/java/com/airbnb/lottie/utils/BaseLottieAnimator.java","lineNumber":18,"sourceCode":"package com.airbnb.lottie.utils;\n\nimport android.animation.Animator;\nimport android.animation.TimeInterpolator;\nimport android.animation.ValueAnimator;\nimport android.os.Build;\n\nimport java.util.Set;\nimport java.util.concurrent.CopyOnWriteArraySet;\n\npublic abstract class BaseLottieAnimator extends ValueAnimator {\n  private final Set<ValueAnimator.AnimatorUpdateListener> updateListeners = new CopyOnWriteArraySet<>();\n  private final Set<AnimatorListener> listeners = new CopyOnWriteArraySet<>();\n  private final Set<Animator.AnimatorPauseListener> pauseListeners = new CopyOnWriteArraySet<>();\n\n\n  @Override public long getStartDelay() {\n    throw new UnsupportedOperationException(\"LottieAnimator does not support getStartDelay.\");\n  }\n\n  @Override public void setStartDelay(long startDelay) {\n    throw new UnsupportedOperationException(\"LottieAnimator does not support setStartDelay.\");\n  }\n\n  @Override public ValueAnimator setDuration(long duration) {\n    throw new UnsupportedOperationException(\"LottieAnimator does not support setDuration.\");\n  }\n\n  @Override public void setInterpolator(TimeInterpolator value) {\n    throw new UnsupportedOperationException(\"LottieAnimator does not support setInterpolator.\");\n  }\n\n  public void addUpdateListener(ValueAnimator.AnimatorUpdateListener listener) {\n    updateListeners.add(listener);\n  }\n","sourceCodeStart":1,"sourceCodeEnd":36,"githubUrl":"https://github.com/airbnb/lottie-android/blob/05ea92e90381eb8a8ae06855ea2b74f322bebbec/lottie/src/main/java/com/airbnb/lottie/utils/BaseLottieAnimator.java#L1-L36","documentation":"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.","triggerScenarios":"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.","commonSituations":"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().","solutions":["Remove the getStartDelay() call — Lottie does not support start delays; use external scheduling (Handler.postDelayed, coroutine delay, etc.) if you need delayed playback","If you need delayed start, wrap LottieAnimationView.playAnimation() in a Handler.postDelayed or use an AnimatorSet with a placeholder delay animator","If using an animation orchestration framework, exclude LottieAnimator from generic property introspection or provide a custom adapter"],"exampleFix":"// before: animator.getStartDelay();\n// after:  // LottieAnimator doesn't support start delay.\n//         // To delay playback, use external scheduling:\n//         handler.postDelayed(() -> lottieAnimationView.playAnimation(), delayMs);\n\n// Or with AnimatorSet for framework compatibility:\n// AnimatorSet set = new AnimatorSet();\n// set.play(lottieAnimator).after(delayMs); // but do NOT call getStartDelay on lottieAnimator","handlingStrategy":"type-guard","validationCode":null,"typeGuard":"// Guard against calling getStartDelay on LottieAnimator\nboolean isLottieAnimator(ValueAnimator animator) {\n  return animator instanceof BaseLottieAnimator;\n}\n\n// Safe access:\nlong safeGetStartDelay(ValueAnimator animator) {\n  if (animator instanceof BaseLottieAnimator) {\n    return 0; // LottieAnimator doesn't support start delay\n  }\n  return animator.getStartDelay();\n}","tryCatchPattern":null,"preventionTips":["Never call getStartDelay() on LottieValueAnimator or LottieAnimationView's internal animator","Use external scheduling (Handler.postDelayed) for delayed Lottie playback","If writing generic animation utilities, type-check for BaseLottieAnimator before calling unsupported methods"],"tags":["lottie","animation","unsupported-operation","android"],"backgroundTag":null,"analyzedSha":"05ea92e90381eb8a8ae06855ea2b74f322bebbec","analyzedAt":"2026-08-14T00:51:35.636Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}