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

Bug: InitAnimationViewForElement throws: ArgumentNullException (Value cannot be null.) #181

Closed galadril closed 6 years ago

galadril commented 6 years ago

Steps to reproduce :scroll:

  1. Run SimpleAppIntro sample project on iOS or Android and start the animated app intro: https://github.com/galadril/Xam.Plugin.SimpleAppIntro
  2. I now show the lottie animation within a carouselview.. moving between view via gestures has no issue. But as soon as i use a next button (that sets the currentPosition in the viewmodel) i get a crash on the lottie animation (see crash details below)
  3. The lottie view has a binding for the Animation, and I'm sure that all animations have a valid json file (all animations are correctly loaded via gestures)

Expected behavior :thinking:

The animation should show up

Actual behavior :bug:

I get an exception on the Init of AnimationViewRenderer.InitAnimationViewForElement: System.ArgumentNullException: Value cannot be null. Parameter name: path

Configuration :wrench:

Version: 2.5.4

Platform:

Tested via Xamarin forms build to Android and iOS

Crash report


**Unhandled Exception:**
System.ArgumentNullException: Value cannot be null.
Parameter name: path
  at Foundation.NSUrl..ctor (System.String path, System.Boolean isDir) [0x0000e] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.14.0.11/src/Xamarin.iOS/Foundation/NSUrl.g.cs:112 
  at Foundation.NSUrl.FromFilename (System.String url) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.14.0.11/src/Xamarin.iOS/Foundation/NSUrl.cs:85 
  at Lottie.Forms.iOS.Renderers.AnimationViewRenderer.InitAnimationViewForElement (Lottie.Forms.AnimationView theElement) [0x00000] in /Users/martijn/Documents/OpenSource/LottieXamarin/Lottie.Forms/Platforms/Ios/AnimationViewRenderer.cs:113 
  at Lottie.Forms.iOS.Renderers.AnimationViewRenderer.OnElementPropertyChanged (System.Object sender, System.ComponentModel.PropertyChangedEventArgs e) [0x00047] in /Users/martijn/Documents/OpenSource/LottieXamarin/Lottie.Forms/Platforms/Ios/AnimationViewRen
derer.cs:89 
  at (wrapper delegate-invoke) <Module>.invoke_void_object_PropertyChangedEventArgs(object,System.ComponentModel.PropertyChangedEventArgs)
  at Xamarin.Forms.BindableObject.OnPropertyChanged (System.String propertyName) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:150 
  at Xamarin.Forms.Element.OnPropertyChanged (System.String propertyName) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\Element.cs:398 
  at Xamarin.Forms.BindableObject.SetValueActual (Xamarin.Forms.BindableProperty property, Xamarin.Forms.BindableObject+BindablePropertyContext context, System.Object value, System.Boolean currentlyApplying, Xamarin.Forms.Internals.SetValueFlags attributes, System.Boolean silent) [0x00114] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:623 
  at Xamarin.Forms.BindableObject.SetValueCore (Xamarin.Forms.BindableProperty property, System.Object value, Xamarin.Forms.Internals.SetValueFlags attributes, Xamarin.Forms.BindableObject+SetValuePrivateFlags privateAttributes) [0x0015b] in D:\a\1\s\
Xamarin.Forms.Core\BindableObject.cs:417 
  at Xamarin.Forms.BindableObject.SetValue (Xamarin.Forms.BindableProperty property, System.Object value, System.Boolean fromStyle, System.Boolean checkAccess) [0x0003d] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:573 
  at Xamarin.Forms.BindableObject.SetValue (Xamarin.Forms.BindableProperty property, System.Object value) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:99 
  at Lottie.Forms.AnimationView.set_Animation (System.String value) [0x00000] in /Users/martijn/Documents/OpenSource/LottieXamarin/Lottie.Forms/AnimationView.cs:55 
  at Xam.Plugin.SimpleAppIntro.Views.AnimatedSlideView.OnIconSelected (System.Object sender, System.ComponentModel.PropertyChangedEventArgs e) [0x00001] in C:\intro\Xam.Plugin.SimpleAppIntro\Views\AnimatedSlideView.xaml.cs:28 
  at (wrapper delegate-invoke) <Module>.invoke_void_object_PropertyChangedEventArgs(object,System.ComponentModel.PropertyChangedEventArgs)
  at Xamarin.Forms.BindableObject.OnPropertyChanged (Syste
m.String propertyName) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:150 
  at Xamarin.Forms.Element.OnPropertyChanged (System.String propertyName) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\Element.cs:398 
  at Xamarin.Forms.BindableObject.SetValueActual (Xamarin.Forms.BindableProperty property, Xamarin.Forms.BindableObject+BindablePropertyContext context, System.Object value, System.Boolean currentlyApplying, Xamarin.Forms.Internals.SetValueFlags attributes, System.Boolean silent) [0x00114] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:623 
  at Xamarin.Forms.BindableObject.SetValueCore (Xamarin.Forms.BindableProperty property, System.Object value, Xamarin.Forms.Internals.SetValueFlags attributes, Xamarin.Forms.BindableObject+SetValuePrivateFlags privateAttributes) [0x0015b] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:417 
  at Xamarin.Forms.BindingExpression.ApplyCore (System.Object sourceObject, Xamarin.Forms.BindableObject target, Xamarin.Forms.BindableProperty property, System.Boolean
 fromTarget) [0x00216] in D:\a\1\s\Xamarin.Forms.Core\BindingExpression.cs:173 
  at Xamarin.Forms.BindingExpression.Apply (System.Object sourceObject, Xamarin.Forms.BindableObject target, Xamarin.Forms.BindableProperty property) [0x0006b] in D:\a\1\s\Xamarin.Forms.Core\BindingExpression.cs:78 
  at Xamarin.Forms.Binding.Apply (System.Object newContext, Xamarin.Forms.BindableObject bindObj, Xamarin.Forms.BindableProperty targetProperty, System.Boolean fromBindingContextChanged) [0x00057] in D:\a\1\s\Xamarin.Forms.Core\Binding.cs:131 
  at Xamarin.Forms.BindableObject.ApplyBindings (System.Boolean skipBindingContext, System.Boolean fromBindingContextChanged) [0x0003c] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:448 
  at Xamarin.Forms.BindableObject.SetInheritedBindingContext (Xamarin.Forms.BindableObject bindable, System.Object value) [0x0005a] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:135 
  at Xamarin.Forms.Element.SetChildInheritedBindingContext (Xamarin.Forms.Element child, System.Object conte
xt) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\Element.cs:532 
  at Xamarin.Forms.Element.OnBindingContextChanged () [0x00021] in D:\a\1\s\Xamarin.Forms.Core\Element.cs:352 
  at Xamarin.Forms.View.OnBindingContextChanged () [0x00042] in D:\a\1\s\Xamarin.Forms.Core\View.cs:150 
  at Xamarin.Forms.BindableObject.SetInheritedBindingContext (Xamarin.Forms.BindableObject bindable, System.Object value) [0x00062] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:136 
  at Xamarin.Forms.Element.SetChildInheritedBindingContext (Xamarin.Forms.Element child, System.Object context) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\Element.cs:532 
  at Xamarin.Forms.TemplatedView.SetChildInheritedBindingContext (Xamarin.Forms.Element child, System.Object context) [0x00008] in D:\a\1\s\Xamarin.Forms.Core\TemplatedView.cs:65 
  at Xamarin.Forms.Element.OnBindingContextChanged () [0x00021] in D:\a\1\s\Xamarin.Forms.Core\Element.cs:352 
  at Xamarin.Forms.View.OnBindingContextChanged () [0x00042] in D:\a\1\s\Xamarin.Forms.Core\View.cs:1
50 
  at Xamarin.Forms.ContentView.OnBindingContextChanged () [0x00000] in D:\a\1\s\Xamarin.Forms.Core\ContentView.cs:16 
  at Xamarin.Forms.BindableObject.BindingContextPropertyChanged (Xamarin.Forms.BindableObject bindable, System.Object oldvalue, System.Object newvalue) [0x0000f] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:468 
  at Xamarin.Forms.BindableObject.SetValueActual (Xamarin.Forms.BindableProperty property, Xamarin.Forms.BindableObject+BindablePropertyContext context, System.Object value, System.Boolean currentlyApplying, Xamarin.Forms.Internals.SetValueFlags attributes, System.Boolean silent) [0x00120] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:625 
  at Xamarin.Forms.BindableObject.SetValueCore (Xamarin.Forms.BindableProperty property, System.Object value, Xamarin.Forms.Internals.SetValueFlags attributes, Xamarin.Forms.BindableObject+SetValuePrivateFlags privateAttributes) [0x0015b] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:417 
  at Xamarin.Forms.BindableObject.SetValue (Xama
rin.Forms.BindableProperty property, System.Object value, System.Boolean fromStyle, System.Boolean checkAccess) [0x0003d] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:573 
  at Xamarin.Forms.BindableObject.SetValue (Xamarin.Forms.BindableProperty property, System.Object value) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:99 
  at Xamarin.Forms.BindableObject.set_BindingContext (System.Object value) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:25 
  at PanCardView.CardsView.CleanView (Xamarin.Forms.View view) [0x0001b] in <20a969e797574362a007100645ed2545>:0 
  at PanCardView.CardsView.EndAutoNavigation (Xamarin.Forms.View oldView, Xamarin.Forms.View newView, System.Guid animationId, PanCardView.Enums.AnimationDirection animationDirection) [0x00028] in <20a969e797574362a007100645ed2545>:0 
  at PanCardView.CardsView+<TryAutoNavigate>d__197.MoveNext () [0x001c5] in <20a969e797574362a007100645ed2545>:0 
--- End of stack trace from previous location where exception was thrown ---

 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x00037] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.14.0.11/src/Xamarin.iOS/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:187 
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.14.0.11/src/Xamarin.iOS/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:156 
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.14.0.11/src/Xamarin.iOS/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:128 
  at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.14.0.11/src/Xamarin.iOS/mcs/
class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:357 
  at PanCardView.CardsView+<SetCurrentView>d__194.MoveNext () [0x0007d] in <20a969e797574362a007100645ed2545>:0 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.<ThrowAsync>b__6_0 (System.Object state) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.14.0.11/src/Xamarin.iOS/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/AsyncMethodBuilder.cs:1018 
  at Foundation.NSAsyncSynchronizationContextDispatcher.Apply () [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.14.0.11/src/Xamarin.iOS/Foundation/NSAction.cs:178 
--- End of stack trace from previous location where exception was thrown ---
  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 /Library/Frameworks/Xamarin.iOS.framework/Versions/11.14.0.11/src/Xamarin.iOS/UIKit/UIApplication.cs:79 
  at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x0002c] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.14.0.11/src/Xamarin.iOS/UIKit/UIApplication.cs:63 
  at Xam.Plugin.SimpleAppIntro.iOS.Application.Main (System.String[] args) [0x00001] in C:\intro\Samples\Xam.Plugin.SimpleAppIntro.Samples\Xam.Plugin.SimpleAppIntro.Samples.iOS\Main.cs:17 
2018-08-17 02:18:16.481 Xam.Plugin.SimpleAppIntro.iOS[37838:10565884] Unhandled managed exception:
Value cannot be null.
Parameter name: path (System.ArgumentNullException)
  at Foundation.NSUrl..ctor (System.String path, System.Boolean isDir) [0x0000e] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.14.0.11/src/Xamarin.iOS/Foundation/NSUrl.g.cs:112 
  at Foundation.NSUrl.FromFilename (System.String url) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versi
ons/11.14.0.11/src/Xamarin.iOS/Foundation/NSUrl.cs:85 
  at Lottie.Forms.iOS.Renderers.AnimationViewRenderer.InitAnimationViewForElement (Lottie.Forms.AnimationView theElement) [0x00000] in /Users/martijn/Documents/OpenSource/LottieXamarin/Lottie.Forms/Platforms/Ios/AnimationViewRenderer.cs:113 
  at Lottie.Forms.iOS.Renderers.AnimationViewRenderer.OnElementPropertyChanged (System.Object sender, System.ComponentModel.PropertyChangedEventArgs e) [0x00047] in /Users/martijn/Documents/OpenSource/LottieXamarin/Lottie.Forms/Platforms/Ios/AnimationViewRenderer.cs:89 
  at (wrapper delegate-invoke) <Module>.invoke_void_object_PropertyChangedEventArgs(object,System.ComponentModel.PropertyChangedEventArgs)
  at Xamarin.Forms.BindableObject.OnPropertyChanged (System.String propertyName) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:150 
  at Xamarin.Forms.Element.OnPropertyChanged (System.String propertyName) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\Element.cs:398 
  at Xamarin.Forms.BindableObject.SetValu
eActual (Xamarin.Forms.BindableProperty property, Xamarin.Forms.BindableObject+BindablePropertyContext context, System.Object value, System.Boolean currentlyApplying, Xamarin.Forms.Internals.SetValueFlags attributes, System.Boolean silent) [0x00114] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:623 
  at Xamarin.Forms.BindableObject.SetValueCore (Xamarin.Forms.BindableProperty property, System.Object value, Xamarin.Forms.Internals.SetValueFlags attributes, Xamarin.Forms.BindableObject+SetValuePrivateFlags privateAttributes) [0x0015b] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:417 
  at Xamarin.Forms.BindableObject.SetValue (Xamarin.Forms.BindableProperty property, System.Object value, System.Boolean fromStyle, System.Boolean checkAccess) [0x0003d] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:573 
  at Xamarin.Forms.BindableObject.SetValue (Xamarin.Forms.BindableProperty property, System.Object value) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:99 
  at Lottie.Forms.AnimationView.se
t_Animation (System.String value) [0x00000] in /Users/martijn/Documents/OpenSource/LottieXamarin/Lottie.Forms/AnimationView.cs:55 
  at Xam.Plugin.SimpleAppIntro.Views.AnimatedSlideView.OnIconSelected (System.Object sender, System.ComponentModel.PropertyChangedEventArgs e) [0x00001] in C:\intro\Xam.Plugin.SimpleAppIntro\Views\AnimatedSlideView.xaml.cs:28 
  at (wrapper delegate-invoke) <Module>.invoke_void_object_PropertyChangedEventArgs(object,System.ComponentModel.PropertyChangedEventArgs)
  at Xamarin.Forms.BindableObject.OnPropertyChanged (System.String propertyName) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:150 
  at Xamarin.Forms.Element.OnPropertyChanged (System.String propertyName) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\Element.cs:398 
  at Xamarin.Forms.BindableObject.SetValueActual (Xamarin.Forms.BindableProperty property, Xamarin.Forms.BindableObject+BindablePropertyContext context, System.Object value, System.Boolean currentlyApplying, Xamarin.Forms.Internals.SetValueFlags attri
butes, System.Boolean silent) [0x00114] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:623 
  at Xamarin.Forms.BindableObject.SetValueCore (Xamarin.Forms.BindableProperty property, System.Object value, Xamarin.Forms.Internals.SetValueFlags attributes, Xamarin.Forms.BindableObject+SetValuePrivateFlags privateAttributes) [0x0015b] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:417 
  at Xamarin.Forms.BindingExpression.ApplyCore (System.Object sourceObject, Xamarin.Forms.BindableObject target, Xamarin.Forms.BindableProperty property, System.Boolean fromTarget) [0x00216] in D:\a\1\s\Xamarin.Forms.Core\BindingExpression.cs:173 
  at Xamarin.Forms.BindingExpression.Apply (System.Object sourceObject, Xamarin.Forms.BindableObject target, Xamarin.Forms.BindableProperty property) [0x0006b] in D:\a\1\s\Xamarin.Forms.Core\BindingExpression.cs:78 
  at Xamarin.Forms.Binding.Apply (System.Object newContext, Xamarin.Forms.BindableObject bindObj, Xamarin.Forms.BindableProperty targetProperty, System.Boolean fromBindingCo
ntextChanged) [0x00057] in D:\a\1\s\Xamarin.Forms.Core\Binding.cs:131 
  at Xamarin.Forms.BindableObject.ApplyBindings (System.Boolean skipBindingContext, System.Boolean fromBindingContextChanged) [0x0003c] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:448 
  at Xamarin.Forms.BindableObject.SetInheritedBindingContext (Xamarin.Forms.BindableObject bindable, System.Object value) [0x0005a] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:135 
  at Xamarin.Forms.Element.SetChildInheritedBindingContext (Xamarin.Forms.Element child, System.Object context) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\Element.cs:532 
  at Xamarin.Forms.Element.OnBindingContextChanged () [0x00021] in D:\a\1\s\Xamarin.Forms.Core\Element.cs:352 
  at Xamarin.Forms.View.OnBindingContextChanged () [0x00042] in D:\a\1\s\Xamarin.Forms.Core\View.cs:150 
  at Xamarin.Forms.BindableObject.SetInheritedBindingContext (Xamarin.Forms.BindableObject bindable, System.Object value) [0x00062] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:136 
  at X
amarin.Forms.Element.SetChildInheritedBindingContext (Xamarin.Forms.Element child, System.Object context) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\Element.cs:532 
  at Xamarin.Forms.TemplatedView.SetChildInheritedBindingContext (Xamarin.Forms.Element child, System.Object context) [0x00008] in D:\a\1\s\Xamarin.Forms.Core\TemplatedView.cs:65 
  at Xamarin.Forms.Element.OnBindingContextChanged () [0x00021] in D:\a\1\s\Xamarin.Forms.Core\Element.cs:352 
  at Xamarin.Forms.View.OnBindingContextChanged () [0x00042] in D:\a\1\s\Xamarin.Forms.Core\View.cs:150 
  at Xamarin.Forms.ContentView.OnBindingContextChanged () [0x00000] in D:\a\1\s\Xamarin.Forms.Core\ContentView.cs:16 
  at Xamarin.Forms.BindableObject.BindingContextPropertyChanged (Xamarin.Forms.BindableObject bindable, System.Object oldvalue, System.Object newvalue) [0x0000f] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:468 
  at Xamarin.Forms.BindableObject.SetValueActual (Xamarin.Forms.BindableProperty property, Xamarin.Forms.BindableObject+BindablePro
pertyContext context, System.Object value, System.Boolean currentlyApplying, Xamarin.Forms.Internals.SetValueFlags attributes, System.Boolean silent) [0x00120] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:625 
  at Xamarin.Forms.BindableObject.SetValueCore (Xamarin.Forms.BindableProperty property, System.Object value, Xamarin.Forms.Internals.SetValueFlags attributes, Xamarin.Forms.BindableObject+SetValuePrivateFlags privateAttributes) [0x0015b] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:417 
  at Xamarin.Forms.BindableObject.SetValue (Xamarin.Forms.BindableProperty property, System.Object value, System.Boolean fromStyle, System.Boolean checkAccess) [0x0003d] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:573 
  at Xamarin.Forms.BindableObject.SetValue (Xamarin.Forms.BindableProperty property, System.Object value) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:99 
  at Xamarin.Forms.BindableObject.set_BindingContext (System.Object value) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\Bindable
Object.cs:25 
  at PanCardView.CardsView.CleanView (Xamarin.Forms.View view) [0x0001b] in <20a969e797574362a007100645ed2545>:0 
  at PanCardView.CardsView.EndAutoNavigation (Xamarin.Forms.View oldView, Xamarin.Forms.View newView, System.Guid animationId, PanCardView.Enums.AnimationDirection animationDirection) [0x00028] in <20a969e797574362a007100645ed2545>:0 
  at PanCardView.CardsView+<TryAutoNavigate>d__197.MoveNext () [0x001c5] in <20a969e797574362a007100645ed2545>:0 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x00037] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.14.0.11/src/Xamarin.iOS/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:187 
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in /Library/Frameworks/Xamarin.iOS.framework/Versions/1
1.14.0.11/src/Xamarin.iOS/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:156 
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.14.0.11/src/Xamarin.iOS/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:128 
  at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.14.0.11/src/Xamarin.iOS/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:357 
  at PanCardView.CardsView+<SetCurrentView>d__194.MoveNext () [0x0007d] in <20a969e797574362a007100645ed2545>:0 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.<ThrowAsync>b__6_0 (System.Object state) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.14.0.11/src/Xamarin.iOS/
mcs/class/referencesource/mscorlib/system/runtime/compilerservices/AsyncMethodBuilder.cs:1018 
  at Foundation.NSAsyncSynchronizationContextDispatcher.Apply () [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.14.0.11/src/Xamarin.iOS/Foundation/NSAction.cs:178 
--- End of stack trace from previous location where exception was thrown ---
  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 /Library/Frameworks/Xamarin.iOS.framework/Versions/11.14.0.11/src/Xamarin.iOS/UIKit/UIApplication.cs:79 
  at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x0002c] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.14.0.11/src/Xamarin.iOS/UIKit/UIApplication.cs:63 
  at Xam.Plugin.SimpleAppIntro.iOS.Application.Main (System.String[] args) [0x00001] in C:\intro\Samples\Xam.Pl
ugin.SimpleAppIntro.Samples\Xam.Plugin.SimpleAppIntro.Samples.iOS\Main.cs:17 
2018-08-17 02:18:16.482 Xam.Plugin.SimpleAppIntro.iOS[37838:10565884] critical: Stacktrace:

2018-08-17 02:18:16.482 Xam.Plugin.SimpleAppIntro.iOS[37838:10565884] critical: 
Native stacktrace:

2018-08-17 02:18:16.484 Xam.Plugin.SimpleAppIntro.iOS[37838:10565884] critical:     0   Xam.Plugin.SimpleAppIntro.iOS       0x00000001033fdeb4 mono_handle_native_crash + 244
2018-08-17 02:18:16.485 Xam.Plugin.SimpleAppIntro.iOS[37838:10565884] critical:     1   libsystem_platform.dylib            0x00000001143e4f5a _sigtramp + 26
2018-08-17 02:18:16.485 Xam.Plugin.SimpleAppIntro.iOS[37838:10565884] critical:     2   libsystem_pthread.dylib             0x000000011440330b _pthread_keys + 9723
2018-08-17 02:18:16.485 Xam.Plugin.SimpleAppIntro.iOS[37838:10565884] critical:     3   libsystem_c.dylib                   0x000000011401ac97 abort + 127
2018-08-17 02:18:16.485 Xam.Plugin.SimpleAppIntro.iOS[37838:10565884] critical:     4   Xam.Plugin.SimpleAppIntro.iO
S       0x00000001035ee07f xamarin_unhandled_exception_handler + 47
2018-08-17 02:18:16.485 Xam.Plugin.SimpleAppIntro.iOS[37838:10565884] critical:     5   Xam.Plugin.SimpleAppIntro.iOS       0x000000010349520e mono_invoke_unhandled_exception_hook + 158
2018-08-17 02:18:16.485 Xam.Plugin.SimpleAppIntro.iOS[37838:10565884] critical:     6   Xam.Plugin.SimpleAppIntro.iOS       0x00000001033fda80 mono_handle_exception_internal + 6240
2018-08-17 02:18:16.485 Xam.Plugin.SimpleAppIntro.iOS[37838:10565884] critical:     7   Xam.Plugin.SimpleAppIntro.iOS       0x00000001033fc219 mono_handle_exception + 25
2018-08-17 02:18:16.486 Xam.Plugin.SimpleAppIntro.iOS[37838:10565884] critical:     8   Xam.Plugin.SimpleAppIntro.iOS       0x000000010337d533 mono_amd64_throw_exception + 131
2018-08-17 02:18:16.486 Xam.Plugin.SimpleAppIntro.iOS[37838:10565884] critical:     9   ???                                 0x000000012e6225a7 0x0 + 5073151399
2018-08-17 02:18:16.486 Xam.Plugin.SimpleAppIntro.iOS[37838:10565884] critical:     10  Xam.Plugin.Si
mpleAppIntro.iOS       0x00000001032dbe9c _ZL31native_to_managed_trampoline_20P11objc_objectP13objc_selectorPP11_MonoMethodj + 284
2018-08-17 02:18:16.486 Xam.Plugin.SimpleAppIntro.iOS[37838:10565884] critical:     11  Xam.Plugin.SimpleAppIntro.iOS       0x00000001032e0434 -[__MonoMac_NSAsyncSynchronizationContextDispatcher xamarinApplySelector] + 52
2018-08-17 02:18:16.486 Xam.Plugin.SimpleAppIntro.iOS[37838:10565884] critical:     12  Foundation                          0x000000010e752d5e __NSThreadPerformPerform + 330
2018-08-17 02:18:16.486 Xam.Plugin.SimpleAppIntro.iOS[37838:10565884] critical:     13  CoreFoundation                      0x0000000111f63bb1 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
2018-08-17 02:18:16.486 Xam.Plugin.SimpleAppIntro.iOS[37838:10565884] critical:     14  CoreFoundation                      0x0000000111f484af __CFRunLoopDoSources0 + 271
2018-08-17 02:18:16.487 Xam.Plugin.SimpleAppIntro.iOS[37838:10565884] critical:     15  CoreFoundation                      0x00000001
11f47a6f __CFRunLoopRun + 1263
2018-08-17 02:18:16.487 Xam.Plugin.SimpleAppIntro.iOS[37838:10565884] critical:     16  CoreFoundation      
galadril commented 6 years ago

Or can this be related to the way your CarouselView library works? @AndreiMisiukevich

AndreiMisiukevich commented 6 years ago

System.ArgumentNullException: Value cannot be null.

@galadril as you can see, my code calls "CleanView" method, which clears bindingContext of hidden views. This method cause bindingContext changed event. Probably, anywhere there is no null-check

at Lottie.Forms.iOS.Renderers.AnimationViewRenderer.OnElementPropertyChanged (System.Object sender, System.ComponentModel.PropertyChangedEventArgs e) [0x00047] in /Users/martijn/Documents/OpenSource/LottieXamarin/Lottie.Forms/Platforms/Ios/AnimationViewRenderer.cs:89

Crash line is above

galadril commented 6 years ago

Thanks for the check!! @AndreiMisiukevich

AndreiMisiukevich commented 6 years ago

https://github.com/martijn00/LottieXamarin/blob/develop/Lottie.Forms/Platforms/Ios/AnimationViewRenderer.cs#L113

I think, adding null-check there will be enough

martijn00 commented 6 years ago

@AndreiMisiukevich can you make a PR to add a null check to all platforms?

AndreiMisiukevich commented 6 years ago

@martijn00 i think yes, but unfortunately, i won't be able to ensure, that it helps exactly... since i don't have reproduction sample =( and have only mac in my own (can't test it on UWP)

martijn00 commented 6 years ago

@AndreiMisiukevich Me or one of the others can probably give UWP a try, but just integrate the code already for that, and i'll get it out in a release.

martijn00 commented 6 years ago

Update with 2.6.0 is available on Nuget. This should fix it. Let me know how it goes.

galadril commented 6 years ago

I still get an exception on the same scenario / code described in the first post.. Only the exception looks a bit changed:


 UNHANDLED EXCEPTION:
 Java.Lang.NullPointerException: key == null
   at Java.Interop.JniEnvironment+InstanceMethods.CallVoidMethod (Java.Interop.JniObjectReference instance, Java.Interop.JniMethodInfo method, Java.Interop.JniArgumentValue* args) [0x00069] in <034d4a9852dd45bea9353cc7776c99f0>:0 
   at Java.Interop.JniPeerMembers+JniInstanceMethods.InvokeVirtualVoidMethod (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters) [0x0002a] in <034d4a9852dd45bea9353cc7776c99f0>:0 
   at Com.Airbnb.Lottie.LottieAnimationView.SetAnimation (System.String assetName) [0x0001f] in C:\Users\mhvdi\Documents\OpenSource\LottieXamarin\Lottie.Android\obj\Release\monoandroid81\generated\src\Com.Airbnb.Lottie.LottieAnimationView.cs:1538 
   at Lottie.Forms.Droid.AnimationViewRenderer.OnElementPropertyChanged (System.Object sender, System.ComponentModel.PropertyChangedEventArgs e) [0x00020] in C:\Users\mhvdi\Documents\OpenSource\LottieXamarin\Lottie.Forms\Platforms\Android\AnimationViewRenderer.cs:165 
   at (wrapper delegate-invoke) <Module>.invoke_void_object_PropertyChangedEventArgs(object,System.ComponentModel.PropertyChangedEventArgs)
   at Xamarin.Forms.BindableObject.OnPropertyChanged (System.String propertyName) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:150 
   at Xamarin.Forms.Element.OnPropertyChanged (System.String propertyName) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\Element.cs:398 
   at Xamarin.Forms.BindableObject.SetValueActual (Xamarin.Forms.BindableProperty property, Xamarin.Forms.BindableObject+BindablePropertyContext context, System.Object value, System.Boolean currentlyApplying, Xamarin.Forms.Internals.SetValueFlags attributes, System.Boolean silent) [0x00114] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:623 
   at Xamarin.Forms.BindableObject.SetValueCore (Xamarin.Forms.BindableProperty property, System.Object value, Xamarin.Forms.Internals.SetValueFlags attributes, Xamarin.Forms.BindableObject+SetValuePrivateFlags privateAttributes) [0x0015b] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:417 
   at Xamarin.Forms.BindingExpression.ApplyCore (System.Object sourceObject, Xamarin.Forms.BindableObject target, Xamarin.Forms.BindableProperty property, System.Boolean fromTarget) [0x00216] in D:\a\1\s\Xamarin.Forms.Core\BindingExpression.cs:173 
   at Xamarin.Forms.BindingExpression.Apply (System.Object sourceObject, Xamarin.Forms.BindableObject target, Xamarin.Forms.BindableProperty property) [0x0006b] in D:\a\1\s\Xamarin.Forms.Core\BindingExpression.cs:78 
   at Xamarin.Forms.Binding.Apply (System.Object newContext, Xamarin.Forms.BindableObject bindObj, Xamarin.Forms.BindableProperty targetProperty, System.Boolean fromBindingContextChanged) [0x00057] in D:\a\1\s\Xamarin.Forms.Core\Binding.cs:131 
   at Xamarin.Forms.BindableObject.ApplyBindings (System.Boolean skipBindingContext, System.Boolean fromBindingContextChanged) [0x0003c] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:448 
   at Xamarin.Forms.BindableObject.SetInheritedBindingContext (Xamarin.Forms.BindableObject bindable, System.Object value) [0x0005a] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:135 An unhandled exception occured.

   at Xamarin.Forms.Element.SetChildInheritedBindingContext (Xamarin.Forms.Element child, System.Object context) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\Element.cs:532 
   at Xamarin.Forms.Element.OnBindingContextChanged () [0x00021] in D:\a\1\s\Xamarin.Forms.Core\Element.cs:352 
   at Xamarin.Forms.View.OnBindingContextChanged () [0x00042] in D:\a\1\s\Xamarin.Forms.Core\View.cs:150 
   at Xamarin.Forms.Grid.OnBindingContextChanged () [0x00006] in D:\a\1\s\Xamarin.Forms.Core\Grid.cs:147 
   at Xamarin.Forms.BindableObject.SetInheritedBindingContext (Xamarin.Forms.BindableObject bindable, System.Object value) [0x00062] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:136 
   at Xamarin.Forms.Element.SetChildInheritedBindingContext (Xamarin.Forms.Element child, System.Object context) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\Element.cs:532 
   at Xamarin.Forms.Element.OnBindingContextChanged () [0x00021] in D:\a\1\s\Xamarin.Forms.Core\Element.cs:352 
   at Xamarin.Forms.View.OnBindingContextChanged () [0x00042] in D:\a\1\s\Xamarin.Forms.Core\View.cs:150 
   at Xamarin.Forms.BindableObject.SetInheritedBindingContext (Xamarin.Forms.BindableObject bindable, System.Object value) [0x00062] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:136 
   at Xamarin.Forms.Element.SetChildInheritedBindingContext (Xamarin.Forms.Element child, System.Object context) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\Element.cs:532 
   at Xamarin.Forms.TemplatedView.SetChildInheritedBindingContext (Xamarin.Forms.Element child, System.Object context) [0x00008] in D:\a\1\s\Xamarin.Forms.Core\TemplatedView.cs:65 
   at Xamarin.Forms.Element.OnBindingContextChanged () [0x00021] in D:\a\1\s\Xamarin.Forms.Core\Element.cs:352 
   at Xamarin.Forms.View.OnBindingContextChanged () [0x00042] in D:\a\1\s\Xamarin.Forms.Core\View.cs:150 
   at Xamarin.Forms.ContentView.OnBindingContextChanged () [0x00000] in D:\a\1\s\Xamarin.Forms.Core\ContentView.cs:16 
   at Xamarin.Forms.BindableObject.BindingContextPropertyChanged (Xamarin.Forms.BindableObject bindable, System.Object oldvalue, System.Object newvalue) [0x0000f] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:468 
   at Xamarin.Forms.BindableObject.SetValueActual (Xamarin.Forms.BindableProperty property, Xamarin.Forms.BindableObject+BindablePropertyContext context, System.Object value, System.Boolean currentlyApplying, Xamarin.Forms.Internals.SetValueFlags attributes, System.Boolean silent) [0x00120] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:625 
   at Xamarin.Forms.BindableObject.SetValueCore (Xamarin.Forms.BindableProperty property, System.Object value, Xamarin.Forms.Internals.SetValueFlags attributes, Xamarin.Forms.BindableObject+SetValuePrivateFlags privateAttributes) [0x0015b] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:417 
   at Xamarin.Forms.BindableObject.SetValue (Xamarin.Forms.BindableProperty property, System.Object value, System.Boolean fromStyle, System.Boolean checkAccess) [0x0003d] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:573 
   at Xamarin.Forms.BindableObject.SetValue (Xamarin.Forms.BindableProperty property, System.Object value) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:99 
   at Xamarin.Forms.BindableObject.set_BindingContext (System.Object value) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:25 
   at PanCardView.CardsView.CleanView (Xamarin.Forms.View view) [0x0001b] in <99dc475f4569488499d88147b66f0dfb>:0 
   at PanCardView.CardsView.EndAutoNavigation (Xamarin.Forms.View oldView, System.Guid animationId, PanCardView.Enums.AnimationDirection animationDirection) [0x00028] in <99dc475f4569488499d88147b66f0dfb>:0 
   at PanCardView.CardsView+<TryAutoNavigate>d__216.MoveNext () [0x001bd] in <99dc475f4569488499d88147b66f0dfb>:0 
 --- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <43dbbdc147f2482093d8409abb04c233>:0 
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <43dbbdc147f2482093d8409abb04c233>:0 
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <43dbbdc147f2482093d8409abb04c233>:0 
   at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in <43dbbdc147f2482093d8409abb04c233>:0 
   at PanCardView.CardsView+<SetCurrentView>d__213.MoveNext () [0x0007d] in <99dc475f4569488499d88147b66f0dfb>:0 
 --- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.<ThrowAsync>b__6_0 (System.Object state) [0x00000] in <43dbbdc147f2482093d8409abb04c233>:0 
   at Android.App.SyncContext+<>c__DisplayClass2_0.<Post>b__0 () [0x00000] in <a10f61e70eeb434e952fef884856c199>:0 
   at Java.Lang.Thread+RunnableImplementor.Run () [0x00008] in <a10f61e70eeb434e952fef884856c199>:0 
   at Java.Lang.IRunnableInvoker.n_Run (System.IntPtr jnienv, System.IntPtr native__this) [0x00009] in <a10f61e70eeb434e952fef884856c199>:0 
   at (wrapper dynamic-method) System.Object.37(intptr,intptr)
   --- End of managed Java.Lang.NullPointerException stack trace ---
 java.lang.NullPointerException: key == null
    at android.support.v4.util.LruCache.get(LruCache.java:80)
    at com.airbnb.lottie.model.LottieCompositionCache.get(LottieCompositionCache.java:40)
    at com.airbnb.lottie.LottieAnimationView.setAnimation(LottieAnimationView.java:388)
    at mono.android.animation.ValueAnimator_AnimatorUpdateListenerImplementor.n_onAnimationUpdate(Native Method)
    at mono.android.animation.ValueAnimator_AnimatorUpdateListenerImplementor.onAnimationUpdate(ValueAnimator_AnimatorUpdateListenerImplementor.java:30)
    at android.animation.ValueAnimator.animateValue(ValueAnimator.java:1522)
    at android.animation.ValueAnimator.animateBasedOnTime(ValueAnimator.java:1316)
    at android.animation.ValueAnimator.doAnimationFrame(ValueAnimator.java:1446)
    at android.animation.AnimationHandler.doAnimationFrame(AnimationHandler.java:146)
    at android.animation.AnimationHandler.-wrap2(Unknown Source:0)
    at android.animation.AnimationHandler$1.doFrame(AnimationHandler.java:54)
    at android.view.Choreographer$CallbackRecord.run(Choreographer.java:966)
    at android.view.Choreographer.doCallbacks(Choreographer.java:780)
    at android.view.Choreographer.doFrame(Choreographer.java:712)
    at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:954)
    at android.os.Handler.handleCallback(Handler.java:790)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:164)
    at android.app.ActivityThread.main(ActivityThread.java:6604)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:518)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:818)
galadril commented 6 years ago

So this case is not really closed, only the exception changed a bit 👍

AndreiMisiukevich commented 6 years ago

@galadril if you want i can try add work around for you from my side but sure thing we should fix this issue on Lottie side

martijn00 commented 6 years ago

So it seems like adding a null check on if Element is still available will do it? If you can confirm i can make the fix.

AndreiMisiukevich commented 6 years ago

@martijn00 so, the caller is there https://github.com/AndreiMisiukevich/CardView/blob/master/PanCardView/CardsView.cs#L1249-L1256

by default view has null context (OnBindingContext changed aren't called) then we set any context (not null) after some actions it can be set null again (in this case OnBindingContext will be called)

We should add null-check for BindingContext.

You can try to reproduce this issue Create view with needed bindingContext, then set BindingContext to null

ios image

I could be wrong, sorry in advance

martijn00 commented 6 years ago

I've released version 2.6.1. Can you check if this works?

galadril commented 6 years ago

Still the same exception as my last one: [ERROR] FATAL UNHANDLED EXCEPTION: Java.Lang.NullPointerException: key == null

Please note that the crash report of my test is different then the first OP one!

galadril commented 6 years ago

Its really easy to test with the project that i've referenced

martijn00 commented 6 years ago

Is the code line still: AnimationViewRenderer.cs:165?

galadril commented 6 years ago

See crash: https://github.com/martijn00/LottieXamarin/issues/181#issuecomment-419001305

at Java.Interop.JniEnvironment+InstanceMethods.CallVoidMethod (Java.Interop.JniObjectReference instance, Java.Interop.JniMethodInfo method, Java.Interop.JniArgumentValue args) [0x00069] in <034d4a9852dd45bea9353cc7776c99f0>:0 at Java.Interop.JniPeerMembers+JniInstanceMethods.InvokeVirtualVoidMethod (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue parameters) [0x0002a] in <034d4a9852dd45bea9353cc7776c99f0>:0 at Com.Airbnb.Lottie.LottieAnimationView.SetAnimation (System.String assetName) [0x0001f] in C:\Users\mhvdi\Documents\OpenSource\LottieXamarin\Lottie.Android\obj\Release\monoandroid81\generated\src\Com.Airbnb.Lottie.LottieAnimationView.cs:1538 at Lottie.Forms.Droid.AnimationViewRenderer.OnElementPropertyChanged (System.Object sender, System.ComponentModel.PropertyChangedEventArgs e) [0x00020] in C:\Users\mhvdi\Documents\OpenSource\LottieXamarin\Lottie.Forms\Platforms\Android\AnimationViewRenderer.cs:165

martijn00 commented 6 years ago

Are you sure that you cleaned your nuget cache and updated correctly? That line should now be on 167: https://github.com/martijn00/LottieXamarin/blob/develop/Lottie.Forms/Platforms/Android/AnimationViewRenderer.cs#L167

AndreiMisiukevich commented 6 years ago

@martijn00 i think, the problem isn't related to Element == null As I see, Element != null, but Element.Animation == null. Am I wrong?

galadril commented 6 years ago

Yeah, i've cleaned/restored/rebuild the whole project :)


09-06 11:51:58.624 E/mono-rt (27125): [ERROR] FATAL UNHANDLED EXCEPTION: Java.Lang.NullPointerException: key == null
09-06 11:51:58.624 E/mono-rt (27125):   at Java.Interop.JniEnvironment+InstanceMethods.CallVoidMethod (Java.Interop.JniObjectReference instance, Java.Interop.JniMethodInfo method, Java.Interop.JniArgumentValue* args) [0x00069] in <034d4a9852dd45bea9353cc7776c99f0>:0 
09-06 11:51:58.624 E/mono-rt (27125):   at Java.Interop.JniPeerMembers+JniInstanceMethods.InvokeVirtualVoidMethod (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters) [0x0002a] in <034d4a9852dd45bea9353cc7776c99f0>:0 
09-06 11:51:58.624 E/mono-rt (27125):   at Com.Airbnb.Lottie.LottieAnimationView.SetAnimation (System.String assetName) [0x0001f] in C:\Users\mhvdi\Documents\OpenSource\LottieXamarin\Lottie.Android\obj\Release\monoandroid81\generated\src\Com.Airbnb.Lottie.LottieAnimationView.cs:1538 
09-06 11:51:58.624 E/mono-rt (27125):   at Lottie.Forms.Droid.AnimationViewRenderer.OnElementPropertyChanged (System.Object sender, System.ComponentModel.PropertyChangedEventArgs e) [0x00030] in C:\Users\mhvdi\Documents\OpenSource\LottieXamarin\Lottie.Forms\Platforms\Android\AnimationViewRenderer.cs:167 
09-06 11:51:58.624 E/mono-rt (27125):   at (wrapper delegate-invoke) <Module>.invoke_void_object_PropertyChangedEventArgs(object,System.ComponentModel.PropertyChangedEventArgs)
09-06 11:51:58.624 E/mono-rt (27125):   at Xamarin.Forms.BindableObject.OnPropertyChanged (System.String propertyName) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:150 
09-06 11:51:58.624 E/mono-rt (27125):   at Xamarin.Forms.Element.OnPropertyChanged (System.String propertyName) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\Element.cs:398 
09-06 11:51:58.624 E/mono-rt (27125):   at Xamarin.Forms.BindableObject.SetValueActual (Xamarin.Forms.BindableProperty property, Xamarin.Forms.BindableObject+BindablePropertyContext context, System.Object value, System.Boolean currentlyApplying, Xamarin.Forms.Internals.SetValueFlags attributes, System.Boolean silent) [0x00114] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:623 
09-06 11:51:58.624 E/mono-rt (27125):   at Xamarin.Forms.BindableObject.SetValueCore (Xamarin.Forms.BindableProperty property, System.Object value, Xamarin.Forms.Internals.SetValueFlags attributes, Xamarin.Forms.BindableObject+SetValuePrivateFlags privateAttributes) [0x0015b] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:417 
09-06 11:51:58.624 E/mono-rt (27125):   at Xamarin.Forms.BindingExpression.ApplyCore (System.Object sourceObject, Xamarin.Forms.BindableObject target, Xamarin.Forms.BindableProperty property, System.Boolean fromTarget) [0x00216] in D:\a\1\s\Xamarin.Forms.Core\BindingExpression.cs:173 
09-06 11:51:58.624 E/mono-rt (27125):   at Xamarin.Forms.BindingExpression.Apply (System.Object sourceObject, Xamarin.Forms.BindableObject target, Xamarin.Forms.BindableProperty property) [0x0006b] in D:\a\1\s\Xamarin.Forms.Core\BindingExpression.cs:78 
09-06 11:51:58.624 E/mono-rt (27125):   at Xamarin.Forms.Binding.Apply (System.Object newContext, Xamarin.Forms.BindableObject bindObj, Xamarin.Forms.BindableProperty targetProperty, System.Boolean fromBindingContextChanged) [0x00057] in D:\a\1\s\Xamarin.Forms.Core\Binding.cs:131 
09-06 11:51:58.624 E/mono-rt (27125):   at Xamarin.Forms.BindableObject.ApplyBindings (System.Boolean skipBindingContext, System.Boolean fromBindingContextChanged) [0x0003c] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:448 
09-06 11:51:58.624 E/mono-rt (27125):   at Xamarin.Forms.BindableObject.SetInheritedBindingContext (Xamarin.Forms.BindableObject bindable, System.Object value) [0x0005a] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:135 
09-06 11:51:58.624 E/mono-rt (27125):   at Xamarin.Forms.Element.SetChildInheritedBindingContext (Xamarin.Forms.Element child, System.Object context) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\Element.cs:532 
09-06 11:51:58.624 E/mono-rt (27125):   at Xamarin.Forms.Element.OnBindingContextChanged () [0x00021] in D:\a\1\s\Xamarin.Forms.Core\Element.cs:352 
09-06 11:51:58.624 E/mono-rt (27125):   at Xamarin.Forms.View.OnBindingContextChanged () [0x00042] in D:\a\1\s\Xamarin.Forms.Core\View.cs:150 
09-06 11:51:58.624 E/mono-rt (27125):   at Xamarin.Forms.Grid.OnBindingContextChanged () [0x00006] in D:\a\1\s\Xamarin.Forms.Core\Grid.cs:147 
09-06 11:51:58.624 E/mono-rt (27125):   at Xamarin.Forms.BindableObject.SetInheritedBindingContext (Xamarin.Forms.BindableObject bindable, System.Object value) [0x00062] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:136 
09-06 11:51:58.624 E/mono-rt (27125):   at Xamarin.Forms.Element.SetChildInheritedBindingContext (Xamarin.Forms.Element child, System.Object context) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\Element.cs:532 
09-06 11:51:58.624 E/mono-rt (27125):   at Xamarin.Forms.
galadril commented 6 years ago

Deeper in the stacktrace, maybe this could be of any help:


09-06 11:51:58.614 E/mono    (27125): java.lang.NullPointerException: key == null
09-06 11:51:58.614 E/mono    (27125):   at android.support.v4.util.LruCache.get(LruCache.java:80)
09-06 11:51:58.614 E/mono    (27125):   at com.airbnb.lottie.model.LottieCompositionCache.get(LottieCompositionCache.java:40)
09-06 11:51:58.614 E/mono    (27125):   at com.airbnb.lottie.LottieAnimationView.setAnimation(LottieAnimationView.java:388)
09-06 11:51:58.614 E/mono    (27125):   at mono.android.animation.ValueAnimator_AnimatorUpdateListenerImplementor.n_onAnimationUpdate(Native Method)
09-06 11:51:58.614 E/mono    (27125):   at mono.android.animation.ValueAnimator_AnimatorUpdateListenerImplementor.onAnimationUpdate(ValueAnimator_AnimatorUpdateListenerImplementor.java:30)
09-06 11:51:58.614 E/mono    (27125):   at android.animation.ValueAnimator.animateValue(ValueAnimator.java:1522)
09-06 11:51:58.614 E/mono    (27125):   at android.animation.ValueAnimator.animateBasedOnTime(ValueAnimator.java:1316)
09-06 11:51:58.614 E/mono    (27125):   at android.animation.ValueAnimator.doAnimationFrame(ValueAnimator.java:1446)
09-06 11:51:58.614 E/mono    (27125):   at android.animation.AnimationHandler.doAnimationFrame(AnimationHandler.java:146)
09-06 11:51:58.614 E/mono    (27125):   at android.animation.AnimationHandler.-wrap2(Unknown Source:0)
09-06 11:51:58.614 E/mono    (27125):   at android.animation.AnimationHandler$1.doFrame(AnimationHandler.java:54)
09-06 11:51:58.614 E/mono    (27125):   at android.view.Choreographer$CallbackRecord.run(Choreographer.java:966)
09-06 11:51:58.614 E/mono    (27125):   at android.view.Choreographer.doCallbacks(Choreographer.java:780)
09-06 11:51:58.614 E/mono    (27125):   at android.view.Choreographer.doFrame(Choreographer.java:712)
09-06 11:51:58.614 E/mono    (27125):   at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:954)
09-06 11:51:58.614 E/mono    (27125):   at android.os.Handler.handleCallback(Handler.java:790)
09-06 11:51:58.614 E/mono    (27125):   at android.os.Handler.dispatchMessage(Handler.java:99)
09-06 11:51:58.614 E/mono    (27125):   at android.os.Looper.loop(Looper.java:164)
09-06 11:51:58.614 E/mono    (27125):   at android.app.ActivityThread.main(ActivityThread.java:6604)
09-06 11:51:58.614 E/mono    (27125):   at java.lang.reflect.Method.invoke(Native Method)
09-06 11:51:58.614 E/mono    (27125):   at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:518)
09-06 11:51:58.614 E/mono    (27125):   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:818)
martijn00 commented 6 years ago

Can you try 2.6.2?

galadril commented 6 years ago

I've installed 2.6.2 but i think that there is something wrong with the latest package: Tried it on two projects, but i can't compile the projects anymore:

Error CS0400 The type or namespace name 'Lottie' could not be found in the global namespace (are you missing an assembly reference?)

And i cleaned, restored, tried to rollback and update again.. 2.6.1 builds, 2.6.2 not

martijn00 commented 6 years ago

@galadril Can you check with 2.6.3?

galadril commented 6 years ago

Yes it works, no crashes anymore! Thanks