Baseflow / LottieXamarin

Render After Effects animations natively on Android, iOS, MacOS and TvOS for Xamarin
https://baseflow.com
Apache License 2.0
1.22k stars 260 forks source link

XF.UWP crash when navigating back #380

Open sjorsmiltenburg opened 2 years ago

sjorsmiltenburg commented 2 years ago

🐛 Bug Report

I have a XF.UWP application.

I am currently using v4.0.11, because with v4.1.0 it does not render any animation on UWP (I will file a separate bug report for that)

v4.0.11 can trigger a crash (unhandled nullref exception) This happens when I quickly navigate away from a page with an Lottie animation. On UWP it seems to need approx 200ms to start animating the visual after displaying the 'begin state'. If I quickly navigate back (for instance with the back button on my mouse), and I am within this 200ms (the animation has not started yet), the app crashes with a nullref exception. If I wait for the animation to start moving, and move back then, all is fine.

Expected behavior

no crash.

Reproduction steps

Configuration

Version: 1.x

Platform:

sjorsmiltenburg commented 2 years ago

In appcenter the following is reported

AnimationViewRenderer._animationView_Loaded (Object sender, RoutedEventArgs e) System.NullReferenceException: Object reference not set to an instance of an object.

stack trace:

AnimationViewRenderer._animationView_Loaded (Object sender, RoutedEventArgs e)
System.Runtime.CompilerServices.AsyncMethodBuilderCore
<>c.<ThrowAsync>b__7_0 (Object state)
System.Threading.WinRTSynchronizationContextBase
Invoker.InvokeCore ()
Windows.ApplicationModel.Core
UnhandledError.Propagate ()
Microsoft.AppCenter.Utils
ApplicationLifecycleHelper.<ctor>b__17_1 (Object sender, UnhandledErrorDetectedEventArgs eventArgs)
sjorsmiltenburg commented 1 year ago

Exception thrown at 0x76DA78A2 (KernelBase.dll) in BB.App.UWP.exe: WinRT originate error - 0x80004003 : 'System.NullReferenceException: Object reference not set to an instance of an object. at Lottie.Forms.Platforms.Uap.AnimationViewRenderer._animationView_Loaded(Object sender, RoutedEventArgs e) at System.Runtime.CompilerServices.AsyncMethodBuilderCore.<>c.b__7_0(Object state) at System.Threading.WinRTSynchronizationContextBase.Invoker.InvokeCore()'.