question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

NoSuchMethodError setImageAssetManager on LottieDrawable

See original GitHub issue

Checklist

  1. My animation doesn’t use any unsupported features.
  2. I know what part of my animation doesn’t work.
  3. I have created a simplified version of my animation
  4. I have attached the AEP file (as a zip file so it can be attached) that only has the part of the animation that doesn’t work.

Describe the bug Using @Composable LottieAnimation leads to a crash: java.lang.NoSuchMethodError: No virtual method setImageAssetManager(Lcom/airbnb/lottie/manager/ImageAssetManager;)V in class Lcom/airbnb/lottie/LottieDrawable; or its super classes (declaration of 'com.airbnb.lottie.LottieDrawable' appears in /data/app/~~rC9ACFpKIQB3QFZSSWzMHA==/app.package-KUTAny4ZZcykm71TfCtL4w==/base.apk) at com.airbnb.lottie.ImageAssetDelegateSetterKt.setImageAssetManager(ImageAssetDelegateSetter.kt:10) at com.airbnb.lottie.compose.LottieAnimationKt$LottieAnimation$3.invoke(LottieAnimation.kt:120) at com.airbnb.lottie.compose.LottieAnimationKt$LottieAnimation$3.invoke(LottieAnimation.kt:106)

Because LottieDrawable does not have the method setImageAssetManager, and ImageAssetDelegateSetter tries to call this method on LottieDrawable, but instead it’s just recursive, as showed by the IDE.

What version of Lottie did you test this on? lottie-android 3.7.1-SNAPSHOT and 3.7.0 lottie-compose 1.0.0-beta09-1-SNAPSHOT and 1.0.0-beta07-1

What version of Android did you test this on? Android 12 on Pixel 4a

Steps To Reproduce Steps to reproduce the behavior:

  1. have a @Composable function
  2. use LottieAnimation @Composable, passing LottieComposition and progress taken from animateLottieCompositionAsState
  3. LottieCompositionSpec is RawRes
  4. run, it crashes with NoSuchMethodError when rendering

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
gpealcommented, Jul 6, 2021
2reactions
headsvkcommented, Jul 6, 2021

You beat me to it by 4 minutes 😄 https://github.com/airbnb/lottie-android/issues/1838 I also forked the repo to reproduce the issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Compose crash: No virtual method setImageAssetManager ...
E/AndroidRuntime: FATAL EXCEPTION: main Process: com.airbnb.lottie.issues.compose, PID: 23472 java.lang.NoSuchMethodError: No virtual method ...
Read more >
Caused by : when trying to play lottie animation - Stack Overflow
I have error Caused by: java.io.FileNotFoundException: assets/loader.json when trying to play lottie animation. As you can see in my layout xml ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found