Baseflow / Baseflow/LottieXamarin

Crash on iOS when using embedded images in Lottie

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

Description

## 🐛 Bug Report

I use Lottie Animations in my cross platform App a lot and this is the first time I needed to use image sequences instead of the vector graphics. Like in a gif. I do need Lottie for this though because of the nice controlls.

The animation was created with After Effects and Bodymovin plugin. The images are embedded into the .json file and I tried to export in the old .json format as well.

When I don't embed the images it does not crash but the images aren't used in the animation (so it's blank). Even when setting the correct path I can't seem to make lottie find the image folder.

The error doesn't say much but this only happens when I include the Lottie animation:
`Foundation.MonoTouchException: 'Objective-C exception thrown. Name: NSInvalidArgumentException Reason: *** -[__NSDictionaryM setObject:forKeyedSubscript:]: key cannot be nil`

It seems like including images does not work on iOS but it works perfectly fine on android. I'm only opening this issue because I haven't seen anything that clearly states this shouldn't work. It obviusly doesn't make sense to use lottie like this anyways but in this case it would be the best solution to my problem, if only it worked on iOS as well.

### Expected behavior
Animation plays on Android and iOS.

### Reproduction steps
1. Create Image sequence in After Effects
2. Render the sequence in Bodymovin with Assets Setting "Include in json" enabled.
3. Import into Xamarin Projekt and test on Android (works) and iOS (crashes)

### Configuration

Lottie.Forms Version: 4.0.11
Xamarin.Forms Version: 5.0.0.2196
Visual Studio Version: 16.11.4

iOS Version: 14.8 and 15 (both crashes)

**Platform:**
- [x] :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

Start by reproducing the crash with Lottie.Forms 4.0.11 using an After Effects image sequence embedded in the JSON on iOS, then compare the same animation on Android. No files or tests are named; done means the iOS animation no longer crashes and the embedded image sequence renders as expected.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, csharp, ios
Domain
mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.