Closed DazOz closed 5 years ago
I get the exactly the same error, whenever I have multiple LottieAnimationViews all playing at the same time. The more there are the more likely it is to crash. It crashes on this line in Path.cs
The same error occurs for me when we have a template whose Lottie view is toggled between Visible and Collapsed.
System.Runtime.InteropServices.COMException: Unspecified error
Attempting to close a CanvasActiveLayer that is not top of the stack. The most recently created layer must be closed first.
at System.Runtime.InteropServices.WindowsRuntime.IClosable.Close()
at System.Runtime.InteropServices.WindowsRuntime.IClosableToIDisposableAdapter.Dispose()
at LottieUWP.LottieDrawable.Draw(CanvasDevice device, BitmapCanvas bitmapCanvas, CompositionLayer compositionLayer, Rect bounds, Single scale, Byte alpha,
It was really hard to debug this issue... It turns out that the Utils class ditn't handle multi-threading at all. I've fixed it.
Works great with 2.8.2 :) Thanks very much!
I have a ItemTemplate inside a listview. When loading my data via my ViewModel (3 rows) I receive the foloowing error. This is random and happens maybe 2 out of five times. Visually each animation is further along than the other,
Exception Message: System.Runtime.InteropServices.COMException: Unspecified error
Attempting to close a CanvasActiveLayer that is not top of the stack. The most recently created layer must be closed first. at System.Runtime.InteropServices.WindowsRuntime.IClosable.Close() at LottieUWP.LottieDrawable.CanvasControlOnDraw(ICanvasAnimatedControl canvasControl, CanvasAnimatedDrawEventArgs args)