Forum Xamarin.Forms

TargetInvocationException Exception when I include/add third party library

Hi,

I have added TwinTechForms library in my project for gesture recogniser. When i try to run it gives me TargetInvocationException. It seems application is unable to found native code written in library project.

I am getting below error. Please find attached screenshot for my project structure.

image

Am I missing any configuration? Please suggest.

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullReferenceException: Object reference not set to an instance of an object
at TwinTechs.Gestures.GestureRecognizerExtensions.ProcessGestureRecognizer (Xamarin.Forms.View view, TwinTechs.Gestures.BaseGestureRecognizer recognizer) [0x0001a] in /Users/yashdeep/Projects/PageViewDemo/TwinTechsForms.Core/TwinTechs/Gestures/GestureRecognizerExtensions.cs:29
at TwinTechs.Gestures.GestureRecognizerExtensions.AddGestureRecognizer (Xamarin.Forms.View view, IGestureRecognizer recognizer) [0x0001d] in /Users/yashdeep/Projects/PageViewDemo/TwinTechsForms.Core/TwinTechs/Gestures/GestureRecognizerExtensions.cs:38
at PageViewDemo.control.ViewPagerControl.add_BindingContextChanged (System.EventHandler value) [0x0005a] in /Users/yashdeep/Projects/PageViewDemo/PageViewDemo/control/ViewPagerControl.cs:65
at at (wrapper managed-to-native) System.Reflection.MonoCMethod:InternalInvoke (System.Reflection.MonoCMethod,object,object[],System.Exception&)
at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters) [0x00002] in /Users/builder/data/lanes/3051/5f11db87/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/corlib/System.Reflection/MonoMethod.cs:644
--- End of inner exception stack trace ---
at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters) [0x00016] in /Users/builder/data/lanes/3051/5f11db87/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/corlib/System.Reflection/MonoMethod.cs:650
at System.RuntimeType.CreateInstanceMono (Boolean nonPublic) [0x000ca] in /Users/builder/data/lanes/3051/5f11db87/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/corlib/ReferenceSources/RuntimeType.cs:113
at System.RuntimeType.CreateInstanceSlow (Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, System.Threading.StackCrawlMark& stackMark) [0x0001a] in /Users/builder/data/lanes/3051/5f11db87/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/corlib/ReferenceSources/RuntimeType.cs:87
at System.RuntimeType.CreateInstanceDefaultCtor (Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, System.Threading.StackCrawlMark& stackMark) [0x0002a] in /Users/builder/data/lanes/3051/5f11db87/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/external/referencesource/mscorlib/system/rttype.cs:5734
at System.Activator.CreateInstance (System.Type type, Boolean nonPublic) [0x00040] in /Users/builder/data/lanes/3051/5f11db87/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/external/referencesource/mscorlib/system/activator.cs:214
at System.Activator.CreateInstance (System.Type type) [0x00000] in /Users/builder/data/lanes/3051/5f11db87/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/external/referencesource/mscorlib/system/activator.cs:147
at Xamarin.Forms.Xaml.CreateValuesVisitor.Visit (Xamarin.Forms.Xaml.ElementNode node, INode parentNode) [0x001e7] in :0

Best Answer

Answers

Sign In or Register to comment.