{"record":{"id":"3344077ff7c0470b","repo":"airbnb/lottie-android","slug":"lottieanimator-does-not-support-setinterpolator","errorCode":null,"errorMessage":"LottieAnimator does not support setInterpolator.","messagePattern":"LottieAnimator does not support setInterpolator\\.","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"lottie/src/main/java/com/airbnb/lottie/utils/BaseLottieAnimator.java","lineNumber":30,"sourceCode":"  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\n  public void removeUpdateListener(ValueAnimator.AnimatorUpdateListener listener) {\n    updateListeners.remove(listener);\n  }\n\n  public void removeAllUpdateListeners() {\n    updateListeners.clear();\n  }\n\n  public void addListener(Animator.AnimatorListener listener) {\n    listeners.add(listener);\n  }\n","sourceCodeStart":12,"sourceCodeEnd":48,"githubUrl":"https://github.com/airbnb/lottie-android/blob/05ea92e90381eb8a8ae06855ea2b74f322bebbec/lottie/src/main/java/com/airbnb/lottie/utils/BaseLottieAnimator.java#L12-L48","documentation":"BaseLottieAnimator overrides ValueAnimator.setInterpolator(TimeInterpolator) to unconditionally throw UnsupportedOperationException. Lottie animations have per-keyframe interpolators defined in the composition JSON (e.g., Bezier easing curves exported from After Effects). Setting a global interpolator would conflict with these per-property interpolators, so the method is disabled.","triggerScenarios":"Calling setInterpolator(interpolator) on a LottieValueAnimator or LottieAnimationView. This can happen directly, or through animation utility code that applies a default interpolator (e.g., DecelerateInterpolator) to all animators. The throw is at BaseLottieAnimator.java:30.","commonSituations":"A developer applies a standard Android interpolator (LinearInterpolator, AccelerateDecelerateInterpolator) expecting it to affect Lottie playback. Code that sets interpolators on all ValueAnimators generically. Migration from standard animation code. Using a shared animation configuration that includes an interpolator.","solutions":["Remove the setInterpolator() call — Lottie interpolators come from the composition's keyframe data and cannot be overridden globally","If you need custom easing for specific properties, set interpolators on individual LottieValueCallback or use LottieProperty key-value overrides","To adjust overall timing feel, use setSpeed() or setMinAndMaxFrame() rather than an interpolator"],"exampleFix":"// before: animator.setInterpolator(new DecelerateInterpolator());\n// after:  // Lottie interpolators come from the After Effects keyframe data.\n//         // Remove the setInterpolator call.\n//         // To customize easing for specific properties, use a value callback:\n//         lottieAnimationView.addValueCallback(\n//             new KeyPath(\"Shape\", \"Transform\", \"Opacity\"),\n//             LottieProperty.OPACITY,\n//             new LottieValueCallback<>(50));","handlingStrategy":"type-guard","validationCode":null,"typeGuard":"// Guard against calling setInterpolator on LottieAnimator\nboolean isLottieAnimator(ValueAnimator animator) {\n  return animator instanceof com.airbnb.lottie.utils.BaseLottieAnimator;\n}\n\n// Safe access:\nvoid safeSetInterpolator(ValueAnimator animator, TimeInterpolator interpolator) {\n  if (animator instanceof com.airbnb.lottie.utils.BaseLottieAnimator) {\n    return; // skip: Lottie uses keyframe interpolators from the composition\n  }\n  animator.setInterpolator(interpolator);\n}","tryCatchPattern":null,"preventionTips":["Never call setInterpolator() on a LottieValueAnimator","Understand that Lottie interpolators come from After Effects keyframe easing data","For custom per-property easing, use LottieValueCallback instead"],"tags":["lottie","animation","unsupported-operation","android","interpolator"],"backgroundTag":null,"analyzedSha":"05ea92e90381eb8a8ae06855ea2b74f322bebbec","analyzedAt":"2026-08-14T00:51:35.636Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}