LottieXamarin icon indicating copy to clipboard operation
LottieXamarin copied to clipboard

Animation stopped working on Android

Open tomh4 opened this issue 3 years ago • 3 comments

🔙 Regression

We had animations loading on Android and iOS, and somehow (maybe with Android 12? Not sure!) They stopped working on Android, but still work on iOS.

Old (and correct) behavior

Displaying the animation on both platforms

Current behavior

Crashing on Android

Java.Lang.NullPointerException: Attempt to invoke virtual method 'com.airbnb.lottie.animation.keyframe.BaseKeyframeAnimation com.airbnb.lottie.model.animatable.AnimatableFloatValue.createAnimation()' on a null object reference
  at java.lang.NullPointerException: Attempt to invoke virtual method 'com.airbnb.lottie.animation.keyframe.BaseKeyframeAnimation com.airbnb.lottie.model.animatable.AnimatableFloatValue.createAnimation()' on a null object reference
  at at com.airbnb.lottie.animation.content.TrimPathContent.<init>(TrimPathContent.java:24)
  at at com.airbnb.lottie.model.content.ShapeTrimPath.toContent(ShapeTrimPath.java:69)
  at at com.airbnb.lottie.animation.content.ContentGroup.contentsFromModels(ContentGroup.java:37)
  at at com.airbnb.lottie.animation.content.ContentGroup.<init>(ContentGroup.java:68)
  at at com.airbnb.lottie.model.layer.ShapeLayer.<init>(ShapeLayer.java:26)
  at at com.airbnb.lottie.model.layer.BaseLayer.forModel(BaseLayer.java:55)
  at at com.airbnb.lottie.model.layer.CompositionLayer.<init>(CompositionLayer.java:56)
  at at com.airbnb.lottie.LottieDrawable.buildCompositionLayer(LottieDrawable.java:322)
  at at com.airbnb.lottie.LottieDrawable.setComposition(LottieDrawable.java:221)
  at at com.airbnb.lottie.LottieAnimationView.setComposition(LottieAnimationView.java:586)
  at at com.airbnb.lottie.LottieAnimationView$2.onResult(LottieAnimationView.java:85)
  at at com.airbnb.lottie.LottieAnimationView$2.onResult(LottieAnimationView.java:83)
  at at com.airbnb.lottie.LottieTask.notifySuccessListeners(LottieTask.java:148)
  at at com.airbnb.lottie.LottieTask.access$100(LottieTask.java:28)
  at at com.airbnb.lottie.LottieTask$1.run(LottieTask.java:135)
  at at android.os.Handler.handleCallback(Handler.java:938)
  at at android.os.Handler.dispatchMessage(Handler.java:99)
  at at android.os.Looper.loop(Looper.java:223)
  at at android.app.ActivityThread.main(ActivityThread.java:7656)
  at at java.lang.reflect.Method.invoke(Native Method)
  at at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
  at at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)

Reproduction steps

Load the attached animation on Xamarin.Forms deployed to Android

Configuration

Version: 4.1.0

Platform:

  • [ ] :iphone: iOS
  • [x] :robot: Android
  • [ ] :checkered_flag: WPF
  • [ ] :earth_americas: UWP
  • [ ] :apple: MacOS
  • [ ] :tv: tvOS
  • [x] :monkey: Xamarin.Forms

tomh4 avatar May 23 '22 20:05 tomh4

anim.txt

tomh4 avatar May 23 '22 20:05 tomh4

I have the same problem..

deelw avatar May 31 '22 11:05 deelw

@tomh4 I added Com.Airbnb.Android.Lottie to my Android project and now it works like a charm!

deelw avatar Jun 03 '22 10:06 deelw