azchohfi / LottieUWP

UWP port of Lottie(https://github.com/airbnb/lottie-android)
Apache License 2.0
274 stars 45 forks source link

Crash in Microsoft.Graphics.Canvas.dll after navigating from page hosting Lottie #66

Closed leviyakir closed 5 years ago

leviyakir commented 5 years ago

Hello,

We are using json animation files rendered by Lottie. When navigating from the page hosting Lottie there is a crash in Microsoft.Graphics.Canvas.dll. I have slightly modified Lottie sample to repro the crash. Diff file is attached. The Lottie assembly changes are to fix build problems on VS2017 and are negligible. The ones in the sample are for the repro. I have built Microsoft.Graphics.Canvas.dll (MS open source) and realized that although LottieDrawable.UserControl_Unloaded is called when navigating from the page, sometimes CanvasAnimatedControl::Unloaded (inside Microsoft.Graphics.Canvas.dll) is not called right after, and that's when the crash occurs. Stack trace of the crash is attached too.

Repro steps (after the applying the diff): 1) Run the LottieUWP.Sample. 2) After the async code of MainPag.OnNavigatedTo is done Navigate button will be revealed. 3) Click Navigate and then click Back repeatedly. You'll get the crash after a few times.

Crash steps attached.

diff.txt StackTrace.txt LottieCrashSteps.zip

Could you help us understand and resolve this issue?

Thanks Yakir

azchohfi commented 5 years ago

This project in not being maintained anymore. Please use LottieWindows: https://github.com/windows-toolkit/Lottie-Windows

Panda-Sharp commented 5 years ago

@azchohfi to keep avoiding these issue, I think you should make it a bit more clear than this:

"This library is a port from the Java code to support the Universal Windows Platform (UWP). For the official Lottie-Windows project, go here: https://aka.ms/lottie"

just the second part of the second sentence it's not too evident

p.s. you could put it in the description of the repo, or as first sentence of the readme for example

leviyakir commented 5 years ago

@azchohfi, should we use https://www.nuget.org/packages/Microsoft.Toolkit.Uwp.UI.Lottie/5.1.1 instead of https://www.nuget.org/packages/LottieUWP/2.8.2 ?