When I set animation_a in xml file and then try to call setAnimation(animation_b) in onViewCreated, it does not work if we already cached this animations. It works as long as Lottie doesn't have cached this animations, which means it works if we disable cache in xml view or when you show it first time with the enabled cache
fork with issue in the issue-repro module - https://github.com/akordev/lottie-android/tree/cache-issue-example
Describe the bug https://github.com/airbnb/lottie-android/pull/2441/files#diff-7ff6236196a28fb237dbe744e4359c6dd062204dfc1f54ea2a8cf0570389c8a1 - changes that cause an issue, line 707 in LottieCompositionFactory, if you revert it to
task = new LottieTask<>(() -> new LottieResult<>(cachedComposition));
bug is not reproducible anymoreWhen I set animation_a in xml file and then try to call setAnimation(animation_b) in onViewCreated, it does not work if we already cached this animations. It works as long as Lottie doesn't have cached this animations, which means it works if we disable cache in xml view or when you show it first time with the enabled cache
Steps to reproduce: