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 261 forks source link

System.NullReferenceException: Object reference not set to an instance of an object #321

Closed gsalve closed 3 years ago

gsalve commented 3 years ago

🐛 Bug Report

System.NullReferenceException: Object reference not set to an instance of an object at Lottie.Forms.Platforms.Ios.AnimationViewRenderer.AnimationCompletionBlock (System.Boolean animationFinished) [0x00017] in C:\Users\mhvdi\Documents\OpenSource\LottieXamarin\Lottie.Forms\Platforms\Ios\AnimationViewRenderer.cs:192 at ObjCRuntime.Trampolines+SDLOTAnimationCompletionBlock.Invoke (System.IntPtr block, System.Boolean animationFinished) [0x00016] in /Users/martijn/Documents/OpenSource/LottieXamarin/Lottie.iOS/obj/Release/xamarin.ios10/ios/ObjCRuntime/Trampolines.g.cs:70 at at (wrapper native-to-managed) ObjCRuntime.Trampolines+SDLOTAnimationCompletionBlock.Invoke(intptr,int) at at (wrapper managed-to-native) UIKit.UIApplication.UIApplicationMain(int,string[],intptr,intptr) at UIKit.UIApplication.Main (System.String[] args, System.IntPtr principal, System.IntPtr delegate) [0x00005] in /Users/builder/azdo/_work/1/s/xamarin-macios/src/UIKit/UIApplication.cs:86 at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x0000e] in /Users/builder/azdo/_work/1/s/xamarin-macios/src/UIKit/UIApplication.cs:65 at DropFitness.Member.FormsApp.iOS.Application.Main (System.String[] args) [0x00001] in /Users/ganesh/Documents/work/dropfitness/dev/depot/dev/DropFitness.Member/DropFitness.Member.FormsApp/DropFitness.Member.FormsApp.iOS/src/Main.cs:10

Expected behavior

I have simple code

AnimationView.OnFinishedAnimation += delegate { if ( this.BindingContext is VM vm ) { //Close popup vm.OnSuccessAnimationFinish(); } };

if I call the above code without finish the callback working fine.

Configuration

Version: 4.0.8

Platform:

martijn00 commented 3 years ago

Should be fixed in the next version