CommunityToolkit / CommunityToolkit/Lottie-Windows

WinUI 3: Unable to use CodeGen'ed animation

Open
#560 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
717
Forks
76
PR merge metrics
No merged PRs in 30d

Description

Hi,
I encounter an exception while loading a codegen'ed Lottie animation.
Trying to reference it in XAML and code-behind fails.

Using XAML, I get the following error and stacktrace:
```
The text associated with this error code could not be found.

Failed to assign to property 'Microsoft.UI.Xaml.Controls.AnimatedVisualPlayer.Source'. [Line: 13 Position: 5]

at WinRT.ExceptionHelpers.g__Throw|39_0(Int32 hr)
```

Using the code-behind method seems to give a more detailed error:
```
The type initializer for '_ICanvasPathBuilderFactory' threw an exception.
```

When trying to use a json file with LottieVisualSource, the same type of exception seems to happen in the background

I've tried with multiple animations, that was working in UWP. (Microsoft.Toolkit.Uwp.UI.Lottie 7.1.1)

Here's a repro project, containing the original json and codegen class:
[TestLottieWinUI3.zip](https://github.com/CommunityToolkit/Lottie-Windows/files/15448410/TestLottieWinUI3.zip)

WinAppSDK version: 1.5.240428000
Lottie version: 8.0.280225

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.