Baseflow / Baseflow/LottieXamarin

Animation stopped working on Android

Open
#383 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
1.2k
Forks
253
PR merge metrics
No merged PRs in 30d

Description

## 🔙 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.(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.(ContentGroup.java:68)
at at com.airbnb.lottie.model.layer.ShapeLayer.(ShapeLayer.java:26)
at at com.airbnb.lottie.model.layer.BaseLayer.forModel(BaseLayer.java:55)
at at com.airbnb.lottie.model.layer.CompositionLayer.(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

Contributor guide

Open the contributing guide

Research direction

Reproduce the attached animation in Xamarin.Forms on Android and follow the stack trace from LottieAnimationView.setComposition through ShapeTrimPath.toContent and TrimPathContent. Done means the animation displays on Android without the reported NullPointerException while the existing iOS behavior remains working.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, csharp
Domain
computer-graphics, mobile-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.