Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

Forms 3.0: System.Reflection.AmbiguousMatchException #2632

Closed
Sebastian1989101 opened this issue May 8, 2018 · 59 comments
Closed

Forms 3.0: System.Reflection.AmbiguousMatchException #2632

Sebastian1989101 opened this issue May 8, 2018 · 59 comments

Comments

@Sebastian1989101
Copy link

After the update to Xamarin.Forms 3.0 I got AmbiguousMatchException all over the place in my code. I'm not 100% why this happens and what it causes yet. A friend of mine got the same exceptions after the update - he has a complete different coding style and uses complete different libraries. Sadly he dosn't know why this happen and where it comes from.

System.Reflection.AmbiguousMatchException: Ambiguous match found.

05-08 16:01:25.641 D/Mono    ( 5777): DllImport attempting to load: '/system/lib/liblog.so'.
05-08 16:01:25.641 D/Mono    ( 5777): DllImport loaded library '/system/lib/liblog.so'.
05-08 16:01:25.642 D/Mono    ( 5777): DllImport searching in: '/system/lib/liblog.so' ('/system/lib/liblog.so').
05-08 16:01:25.642 D/Mono    ( 5777): Searching for '__android_log_print'.
05-08 16:01:25.642 D/Mono    ( 5777): Probing '__android_log_print'.
05-08 16:01:25.642 D/Mono    ( 5777): Found as '__android_log_print'.
05-08 16:01:25.648 I/MonoDroid( 5777): UNHANDLED EXCEPTION:
05-08 16:01:25.662 I/MonoDroid( 5777): System.Reflection.AmbiguousMatchException: Ambiguous match found.
05-08 16:01:25.662 I/MonoDroid( 5777):   at System.RuntimeType.GetPropertyImpl (System.String name, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, System.Type returnType, System.Type[] types, System.Reflection.ParameterModifier[] modifiers) [0x00061] in <f32579baafc1404fa37ba3ec1abdc0bd>:0 
05-08 16:01:25.662 I/MonoDroid( 5777):   at System.Type.GetProperty (System.String name) [0x0000e] in <f32579baafc1404fa37ba3ec1abdc0bd>:0 
05-08 16:01:25.662 I/MonoDroid( 5777):   at Xamarin.Forms.BindingExpression.SetupPart (System.Reflection.TypeInfo sourceType, Xamarin.Forms.BindingExpression+BindingExpressionPart part) [0x00221] in D:\a\1\s\Xamarin.Forms.Core\BindingExpression.cs:341 
05-08 16:01:25.662 I/MonoDroid( 5777):   at Xamarin.Forms.BindingExpression.ApplyCore (System.Object sourceObject, Xamarin.Forms.BindableObject target, Xamarin.Forms.BindableProperty property, System.Boolean fromTarget) [0x000d7] in D:\a\1\s\Xamarin.Forms.Core\BindingExpression.cs:130 
05-08 16:01:25.662 I/MonoDroid( 5777):   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 
05-08 16:01:25.662 I/MonoDroid( 5777):   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 
05-08 16:01:25.662 I/MonoDroid( 5777):   at Xamarin.Forms.BindableObject.SetBinding (Xamarin.Forms.BindableProperty targetProperty, Xamarin.Forms.BindingBase binding, System.Boolean fromStyle) [0x0008b] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:316 
05-08 16:01:25.662 I/MonoDroid( 5777):   at Xamarin.Forms.BindableObject.SetBinding (Xamarin.Forms.BindableProperty targetProperty, Xamarin.Forms.BindingBase binding) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:94 
05-08 16:01:25.662 I/MonoDroid( 5777):   at MHWorldCompanion.Core.Pages.SetSearcherPage+<InitializeComponent>_anonXamlCDataTemplate_58.LoadDataTemplate () [0x00570] in <2bb6b8e8a7094c3ea0df28233dbe1b64>:0 
05-08 16:01:25.662 I/MonoDroid( 5777):   at Xamarin.Forms.ElementTemplate.CreateContent () [0x00026] in D:\a\1\s\Xamarin.Forms.Core\ElementTemplate.cs:82 
05-08 16:01:25.662 I/MonoDroid( 5777):   at MHWorldCompanion.Core.Controls.ItemsStack.GetItemView (System.Object item) [0x00001] in C:\Privat\git\MHWorldCompanion\MHWorldCompanion\MHWorldCompanion.Core\Controls\ItemsStack.cs:68 
05-08 16:01:25.662 I/MonoDroid( 5777):   at MHWorldCompanion.Core.Controls.ItemsStack.CollectionChanged (System.Object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) [0x00045] in C:\Privat\git\MHWorldCompanion\MHWorldCompanion\MHWorldCompanion.Core\Controls\ItemsStack.cs:112 
05-08 16:01:25.662 I/MonoDroid( 5777):   at (wrapper delegate-invoke) <Module>.invoke_void_object_NotifyCollectionChangedEventArgs(object,System.Collections.Specialized.NotifyCollectionChangedEventArgs)
05-08 16:01:25.662 I/MonoDroid( 5777):   at System.Collections.ObjectModel.ObservableCollection`1[T].OnCollectionChanged (System.Collections.Specialized.NotifyCollectionChangedEventArgs e) [0x0000f] in <5a97d41d36694fb19855c17429527b10>:0 
05-08 16:01:25.662 I/MonoDroid( 5777):   at System.Collections.ObjectModel.ObservableCollection`1[T].OnCollectionChanged (System.Collections.Specialized.NotifyCollectionChangedAction action, System.Object item, System.Int32 index) [0x00009] in <5a97d41d36694fb19855c17429527b10>:0 
05-08 16:01:25.662 I/MonoDroid( 5777):   at System.Collections.ObjectModel.ObservableCollection`1[T].InsertItem (System.Int32 index, T item) [0x00024] in <5a97d41d36694fb19855c17429527b10>:0 
05-08 16:01:25.662 I/MonoDroid( 5777):   at System.Collections.ObjectModel.Collection`1[T].Add (T item) [0x00020] in <f32579baafc1404fa37ba3ec1abdc0bd>:0 
05-08 16:01:25.662 I/MonoDroid( 5777):   at MHWorldCompanion.Core.ViewModels.SetSearcherViewModel.ViewAppeared () [0x00027] in C:\Privat\git\MHWorldCompanion\MHWorldCompanion\MHWorldCompanion.Core\ViewModels\SetSearcherViewModel.cs:146 
05-08 16:01:25.662 I/MonoDroid( 5777):   at MvvmCross.Forms.Views.MvxContentPage.OnAppearing () [0x00021] in <0afca477417f4241b92e240f7a530ede>:0 
05-08 16:01:25.662 I/MonoDroid( 5777):   at MHWorldCompanion.Core.Pages.SetSearcherPage.OnAppearing () [0x00001] in C:\Privat\git\MHWorldCompanion\MHWorldCompanion\MHWorldCompanion.Core\Pages\SetSearcherPage.xaml.cs:24 
05-08 16:01:25.662 I/MonoDroid( 5777):   at Xamarin.Forms.Page.SendAppearing () [0x00024] in D:\a\1\s\Xamarin.Forms.Core\Page.cs:313 
05-08 16:01:25.662 I/MonoDroid( 5777):   at Xamarin.Forms.Platform.Android.AppCompat.FragmentContainer.SendLifecycleEvent (System.Boolean isAppearing) [0x0004f] in D:\a\1\s\Xamarin.Forms.Platform.Android\AppCompat\FragmentContainer.cs:132 
05-08 16:01:25.662 I/MonoDroid( 5777):   at Xamarin.Forms.Platform.Android.AppCompat.FragmentContainer.OnResume () [0x00011] in D:\a\1\s\Xamarin.Forms.Platform.Android\AppCompat\FragmentContainer.cs:117 
05-08 16:01:25.662 I/MonoDroid( 5777):   at Android.Support.V4.App.Fragment.n_OnResume (System.IntPtr jnienv, System.IntPtr native__this) [0x00008] in <3682f8af23a748128467fbf9c57ae876>:0 
05-08 16:01:25.662 I/MonoDroid( 5777):   at (wrapper dynamic-method) System.Object.20042f24-e0c2-475b-ac40-41e0634ae0a6(intptr,intptr)
05-08 16:01:25.683 E/AppCenterCrashes( 5777): Unhandled Exception from source=AndroidEnvironment
05-08 16:01:25.683 E/AppCenterCrashes( 5777): System.Reflection.AmbiguousMatchException: Ambiguous match found.
05-08 16:01:25.683 E/AppCenterCrashes( 5777):   at System.RuntimeType.GetPropertyImpl (System.String name, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, System.Type returnType, System.Type[] types, System.Reflection.ParameterModifier[] modifiers) [0x00061] in <f32579baafc1404fa37ba3ec1abdc0bd>:0 
05-08 16:01:25.683 E/AppCenterCrashes( 5777):   at System.Type.GetProperty (System.String name) [0x0000e] in <f32579baafc1404fa37ba3ec1abdc0bd>:0 
05-08 16:01:25.683 E/AppCenterCrashes( 5777):   at Xamarin.Forms.BindingExpression.SetupPart (System.Reflection.TypeInfo sourceType, Xamarin.Forms.BindingExpression+BindingExpressionPart part) [0x00221] in D:\a\1\s\Xamarin.Forms.Core\BindingExpression.cs:341 
05-08 16:01:25.683 E/AppCenterCrashes( 5777):   at Xamarin.Forms.BindingExpression.ApplyCore (System.Object sourceObject, Xamarin.Forms.BindableObject target, Xamarin.Forms.BindableProperty property, System.Boolean fromTarget) [0x000d7] in D:\a\1\s\Xamarin.Forms.Core\BindingExpression.cs:130 
05-08 16:01:25.683 E/AppCenterCrashes( 5777):   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 
05-08 16:01:25.683 E/AppCenterCrashes( 5777):   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 
05-08 16:01:25.683 E/AppCenterCrashes( 5777):   at Xamarin.Forms.BindableObject.SetBinding (Xamarin.Forms.BindableProperty targetProperty, Xamarin.Forms.BindingBase binding, System.Boolean fromStyle) [0x0008b] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:316 
05-08 16:01:25.683 E/AppCenterCrashes( 5777):   at Xamarin.Forms.BindableObject.SetBinding (Xamarin.Forms.BindableProperty targetProperty, Xamarin.Forms.BindingBase binding) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:94 
05-08 16:01:25.683 E/AppCenterCrashes( 5777):   at MHWorldCompanion.Core.Pages.SetSearcherPage+<InitializeComponent>_anonXamlCDataTemplate_58.LoadDataTemplate () [0x00570] in <2bb6b8e8a7094c3ea0df28233dbe1b64>:0 
05-08 16:01:25.683 E/AppCenterCrashes( 5777):   at Xamarin.Forms.ElementTemplate.CreateContent () [0x00026] in D:\a\1\s\Xamarin.Forms.Core\ElementTemplate.cs:82 
05-08 16:01:25.683 E/AppCenterCrashes( 5777):   at MHWorldCompanion.Core.Controls.ItemsStack.GetItemView (System.Object item) [0x00001] in C:\Privat\git\MHWorldCompanion\MHWorldCompanion\MHWorldCompanion.Core\Controls\ItemsStack.cs:68 
05-08 16:01:25.683 E/AppCenterCrashes( 5777):   at MHWorldCompanion.Core.Controls.ItemsStack.CollectionChanged (System.Object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) [0x00045] in C:\Privat\git\MHWorldCompanion\MHWorldCompanion\MHWorldCompanion.Core\Controls\ItemsStack.cs:112 
05-08 16:01:25.683 E/AppCenterCrashes( 5777):   at (wrapper delegate-invoke) <Module>.invoke_void_object_NotifyCollectionChangedEventArgs(object,System.Collections.Specialized.NotifyCollectionChangedEventArgs)
05-08 16:01:25.683 E/AppCenterCrashes( 5777):   at System.Collections.ObjectModel.ObservableCollection`1[T].OnCollectionChanged (System.Collections.Specialized.NotifyCollectionChangedEventArgs e) [0x0000f] in <5a97d41d36694fb19855c17429527b10>:0 
05-08 16:01:25.683 E/AppCenterCrashes( 5777):   at System.Collections.ObjectModel.ObservableCollection`1[T].OnCollectionChanged (System.Collections.Specialized.NotifyCollectionChangedAction action, System.Object item, System.Int32 index) [0x00009] in <5a97d41d36694fb19855c17429527b10>:0 
05-08 16:01:25.683 E/AppCenterCrashes( 5777):   at System.Collections.ObjectModel.ObservableCollection`1[T].InsertItem (System.Int32 index, T item) [0x00024] in <5a97d41d36694fb19855c17429527b10>:0 
05-08 16:01:25.683 E/AppCenterCrashes( 5777):   at System.Collections.ObjectModel.Collection`1[T].Add (T item) [0x00020] in <f32579baafc1404fa37ba3ec1abdc0bd>:0 
05-08 16:01:25.683 E/AppCenterCrashes( 5777):   at MHWorldCompanion.Core.ViewModels.SetSearcherViewModel.ViewAppeared () [0x00027] in C:\Privat\git\MHWorldCompanion\MHWorldCompanion\MHWorldCompanion.Core\ViewModels\SetSearcherViewModel.cs:146 
05-08 16:01:25.683 E/AppCenterCrashes( 5777):   at MvvmCross.Forms.Views.MvxContentPage.OnAppearing () [0x00021] in <0afca477417f4241b92e240f7a530ede>:0 
05-08 16:01:25.683 E/AppCenterCrashes( 5777):   at MHWorldCompanion.Core.Pages.SetSearcherPage.OnAppearing () [0x00001] in C:\Privat\git\MHWorldCompanion\MHWorldCompanion\MHWorldCompanion.Core\Pages\SetSearcherPage.xaml.cs:24 
05-08 16:01:25.683 E/AppCenterCrashes( 5777):   at Xamarin.Forms.Page.SendAppearing () [0x00024] in D:\a\1\s\Xamarin.Forms.Core\Page.cs:313 
05-08 16:01:25.683 E/AppCenterCrashes( 5777):   at Xamarin.Forms.
05-08 16:01:25.692 D/Mono    ( 5777): Assembly Ref addref Microsoft.AppCenter.Crashes[0xa474e8e0] -> System.Core[0xa4419020]: 14
[0:] AndroidEnvironment.UnhandledExceptionRaiser: System.Reflection.AmbiguousMatchException: Ambiguous match found.
  at System.RuntimeType.GetPropertyImpl (System.String name, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, System.Type returnType, System.Type[] types, System.Reflection.ParameterModifier[] modifiers) [0x00061] in <f32579baafc1404fa37ba3ec1abdc0bd>:0 
  at System.Type.GetProperty (System.String name) [0x0000e] in <f32579baafc1404fa37ba3ec1abdc0bd>:0 
  at Xamarin.Forms.BindingExpression.SetupPart (System.Reflection.TypeInfo sourceType, Xamarin.Forms.BindingExpression+BindingExpressionPart part) [0x00221] in D:\a\1\s\Xamarin.Forms.Core\BindingExpression.cs:341 
  at Xamarin.Forms.BindingExpression.ApplyCore (System.Object sourceObject, Xamarin.Forms.BindableObject target, Xamarin.Forms.BindableProperty property, System.Boolean fromTarget) [0x000d7] in D:\a\1\s\Xamarin.Forms.Core\BindingExpression.cs:130 
  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.SetBinding (Xamarin.Forms.BindableProperty targetProperty, Xamarin.Forms.BindingBase binding, System.Boolean fromStyle) [0x0008b] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:316 
  at Xamarin.Forms.BindableObject.SetBinding (Xamarin.Forms.BindableProperty targetProperty, Xamarin.Forms.BindingBase binding) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:94 
  at MHWorldCompanion.Core.Pages.SetSearcherPage+<InitializeComponent>_anonXamlCDataTemplate_58.LoadDataTemplate () [0x00570] in <2bb6b8e8a7094c3ea0df28233dbe1b64>:0 
  at Xamarin.Forms.ElementTemplate.CreateContent () [0x00026] in D:\a\1\s\Xamarin.Forms.Core\ElementTemplate.cs:82 
  at MHWorldCompanion.Core.Controls.ItemsStack.GetItemView (System.Object item) [0x00001] in C:\Privat\git\MHWorldCompanion\MHWorldCompanion\MHWorldCompanion.Core\Controls\ItemsStack.cs:68 
  at MHWorldCompanion.Core.Controls.ItemsStack.CollectionChanged (System.Object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) [0x00045] in C:\Privat\git\MHWorldCompanion\MHWorldCompanion\MHWorldCompanion.Core\Controls\ItemsStack.cs:112 
  at (wrapper delegate-invoke) <Module>.invoke_void_object_NotifyCollectionChangedEventArgs(object,System.Collections.Specialized.NotifyCollectionChangedEventArgs)
  at System.Collections.ObjectModel.ObservableCollection`1[T].OnCollectionChanged (System.Collections.Specialized.NotifyCollectionChangedEventArgs e) [0x0000f] in <5a97d41d36694fb19855c17429527b10>:0 
  at System.Collections.ObjectModel.ObservableCollection`1[T].OnCollectionChanged (System.Collections.Specialized.NotifyCollectionChangedAction action, System.Object item, System.Int32 index) [0x00009] in <5a97d41d36694fb19855c17429527b10>:0 
  at System.Collections.ObjectModel.ObservableCollection`1[T].InsertItem (System.Int32 index, T item) [0x00024] in <5a97d41d36694fb19855c17429527b10>:0 
  at System.Collections.ObjectModel.Collection`1[T].Add (T item) [0x00020] in <f32579baafc1404fa37ba3ec1abdc0bd>:0 
  at MHWorldCompanion.Core.ViewModels.SetSearcherViewModel.ViewAppeared () [0x00027] in C:\Privat\git\MHWorldCompanion\MHWorldCompanion\MHWorldCompanion.Core\ViewModels\SetSearcherViewModel.cs:146 
  at MvvmCross.Forms.Views.MvxContentPage.OnAppearing () [0x00021] in <0afca477417f4241b92e240f7a530ede>:0 
  at MHWorldCompanion.Core.Pages.SetSearcherPage.OnAppearing () [0x00001] in C:\Privat\git\MHWorldCompanion\MHWorldCompanion\MHWorldCompanion.Core\Pages\SetSearcherPage.xaml.cs:24 
  at Xamarin.Forms.Page.SendAppearing () [0x00024] in D:\a\1\s\Xamarin.Forms.Core\Page.cs:313 
  at Xamarin.Forms.Platform.Android.AppCompat.FragmentContainer.SendLifecycleEvent (System.Boolean isAppearing) [0x0004f] in D:\a\1\s\Xamarin.Forms.Platform.Android\AppCompat\FragmentContainer.cs:132 
  at Xamarin.Forms.Platform.Android.AppCompat.FragmentContainer.OnResume () [0x00011] in D:\a\1\s\Xamarin.Forms.Platform.Android\AppCompat\FragmentContainer.cs:117 
  at Android.Support.V4.App.Fragment.n_OnResume (System.IntPtr jnienv, System.IntPtr native__this) [0x00008] in <3682f8af23a748128467fbf9c57ae876>:0 
  at (wrapper dynamic-method) System.Object.20042f24-e0c2-475b-ac40-41e0634ae0a6(intptr,intptr). IsTerminating: False
An unhandled exception occured.

05-08 16:01:37.181 E/mono-rt ( 5777): [ERROR] FATAL UNHANDLED EXCEPTION: System.Reflection.AmbiguousMatchException: Ambiguous match found.
05-08 16:01:37.181 E/mono-rt ( 5777):   at (wrapper dynamic-method) System.Object.20042f24-e0c2-475b-ac40-41e0634ae0a6(intptr,intptr)
05-08 16:01:37.186 D/        ( 5777): HostConnection::get() New Host Connection established 0xa6e1f700, tid 5777
@pauldipietro pauldipietro added this to New in Triage May 8, 2018
@Sebastian1989101
Copy link
Author

And another one:

System.Reflection.AmbiguousMatchException: Ambiguous match found.

05-08 16:08:52.866 D/Mono    ( 6505): DllImport attempting to load: '/system/lib/liblog.so'.
05-08 16:08:52.894 D/Mono    ( 6505): DllImport loaded library '/system/lib/liblog.so'.
05-08 16:08:52.894 D/Mono    ( 6505): DllImport searching in: '/system/lib/liblog.so' ('/system/lib/liblog.so').
05-08 16:08:52.894 D/Mono    ( 6505): Searching for '__android_log_print'.
05-08 16:08:52.894 D/Mono    ( 6505): Probing '__android_log_print'.
05-08 16:08:52.894 D/Mono    ( 6505): Found as '__android_log_print'.
05-08 16:08:52.898 I/MonoDroid( 6505): UNHANDLED EXCEPTION:
05-08 16:08:52.907 I/MonoDroid( 6505): System.Reflection.AmbiguousMatchException: Ambiguous match found.
05-08 16:08:52.907 I/MonoDroid( 6505):   at System.RuntimeType.GetPropertyImpl (System.String name, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, System.Type returnType, System.Type[] types, System.Reflection.ParameterModifier[] modifiers) [0x00061] in <f32579baafc1404fa37ba3ec1abdc0bd>:0 
05-08 16:08:52.907 I/MonoDroid( 6505):   at System.Type.GetProperty (System.String name) [0x0000e] in <f32579baafc1404fa37ba3ec1abdc0bd>:0 
05-08 16:08:52.908 I/MonoDroid( 6505):   at Xamarin.Forms.BindingExpression.SetupPart (System.Reflection.TypeInfo sourceType, Xamarin.Forms.BindingExpression+BindingExpressionPart part) [0x00221] in D:\a\1\s\Xamarin.Forms.Core\BindingExpression.cs:341 
05-08 16:08:52.908 I/MonoDroid( 6505):   at Xamarin.Forms.BindingExpression.ApplyCore (System.Object sourceObject, Xamarin.Forms.BindableObject target, Xamarin.Forms.BindableProperty property, System.Boolean fromTarget) [0x000d7] in D:\a\1\s\Xamarin.Forms.Core\BindingExpression.cs:130 
05-08 16:08:52.908 I/MonoDroid( 6505):   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 
05-08 16:08:52.908 I/MonoDroid( 6505):   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 
05-08 16:08:52.908 I/MonoDroid( 6505):   at Xamarin.Forms.BindableObject.SetBinding (Xamarin.Forms.BindableProperty targetProperty, Xamarin.Forms.BindingBase binding, System.Boolean fromStyle) [0x0008b] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:316 
05-08 16:08:52.908 I/MonoDroid( 6505):   at Xamarin.Forms.BindableObject.SetBinding (Xamarin.Forms.BindableProperty targetProperty, Xamarin.Forms.BindingBase binding) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:94 
05-08 16:08:52.908 I/MonoDroid( 6505):   at MHWorldCompanion.Core.Pages.WeaponSelectionPage+<InitializeComponent>_anonXamlCDataTemplate_75.LoadDataTemplate () [0x001f2] in <2bb6b8e8a7094c3ea0df28233dbe1b64>:0 
05-08 16:08:52.908 I/MonoDroid( 6505):   at Xamarin.Forms.ElementTemplate.CreateContent () [0x00026] in D:\a\1\s\Xamarin.Forms.Core\ElementTemplate.cs:82 
05-08 16:08:52.908 I/MonoDroid( 6505):   at DLToolkit.Forms.Controls.FlowListViewInternalCell.UpdateData () [0x001b1] in <5d4a24d63abc402db6897eb2bcac9fee>:0 
05-08 16:08:52.908 I/MonoDroid( 6505):   at DLToolkit.Forms.Controls.FlowListViewInternalCell.OnBindingContextChanged () [0x00006] in <5d4a24d63abc402db6897eb2bcac9fee>:0 
05-08 16:08:52.908 I/MonoDroid( 6505):   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:477 
05-08 16:08:52.908 I/MonoDroid( 6505):   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) [0x00122] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:636 
05-08 16:08:52.908 I/MonoDroid( 6505):   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:426 
05-08 16:08:52.908 I/MonoDroid( 6505):   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:583 
05-08 16:08:52.908 I/MonoDroid( 6505):   at Xamarin.Forms.BindableObject.SetValue (Xamarin.Forms.BindableProperty property, System.Object value) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:99 
05-08 16:08:52.908 I/MonoDroid( 6505):   at Xamarin.Forms.BindableObject.set_BindingContext (System.Object value) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:25 
05-08 16:08:52.908 I/MonoDroid( 6505):   at Xamarin.Forms.Internals.TemplatedItemsList`2[TView,TItem].UpdateContent (TItem content, System.Int32 index, System.Object item) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\TemplatedItemsList.cs:614 
05-08 16:08:52.908 I/MonoDroid( 6505):   at Xamarin.Forms.Internals.TemplatedItemsList`2[TView,TItem].ActivateContent (System.Int32 index, System.Object item) [0x00038] in D:\a\1\s\Xamarin.Forms.Core\TemplatedItemsList.cs:536 
05-08 16:08:52.908 I/MonoDroid( 6505):   at Xamarin.Forms.Internals.TemplatedItemsList`2[TView,TItem].CreateContent (System.Int32 index, System.Object item, System.Boolean insert) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\TemplatedItemsList.cs:543 
05-08 16:08:52.908 I/MonoDroid( 6505):   at Xamarin.Forms.Internals.TemplatedItemsList`2[TView,TItem].GetOrCreateContent (System.Int32 index, System.Object item) [0x00023] in D:\a\1\s\Xamarin.Forms.Core\TemplatedItemsList.cs:602 
05-08 16:08:52.908 I/MonoDroid( 6505):   at Xamarin.Forms.Internals.TemplatedItemsList`2[TView,TItem].get_Item (System.Int32 index) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\TemplatedItemsList.cs:337 
05-08 16:08:52.908 I/MonoDroid( 6505):   at Xamarin.Forms.Platform.Android.ListViewAdapter.GetCellsFromPosition (System.Int32 position, System.Int32 take) [0x0003b] in D:\a\1\s\Xamarin.Forms.Platform.Android\Renderers\ListViewAdapter.cs:516 
05-08 16:08:52.908 I/MonoDroid( 6505):   at Xamarin.Forms.Platform.Android.ListViewAdapter.GetCellForPosition (System.Int32 position) [0x00000] in D:\a\1\s\Xamarin.Forms.Platform.Android\Renderers\ListViewAdapter.cs:438 
05-08 16:08:52.908 I/MonoDroid( 6505):   at Xamarin.Forms.Platform.Android.ListViewAdapter.GetView (System.Int32 position, Android.Views.View convertView, Android.Views.ViewGroup parent) [0x00081] in D:\a\1\s\Xamarin.Forms.Platform.Android\Renderers\ListViewAdapter.cs:216 
05-08 16:08:52.908 I/MonoDroid( 6505):   at Android.Widget.BaseAdapter.n_GetView_ILandroid_view_View_Landroid_view_ViewGroup_ (System.IntPtr jnienv, System.IntPtr native__this, System.Int32 position, System.IntPtr native_convertView, System.IntPtr native_parent) [0x00018] in <25661073a35344a89f215a4cf81af37c>:0 
05-08 16:08:52.908 I/MonoDroid( 6505):   at (wrapper dynamic-method) System.Object.1a045c58-a8db-46df-873a-24a335f32e3d(intptr,intptr,int,intptr,intptr)
05-08 16:08:52.957 I/zygote  ( 6505): Explicit concurrent copying GC freed 4167(252KB) AllocSpace objects, 0(0B) LOS objects, 49% free, 1721KB/3MB, paused 1.352ms total 14.519ms
05-08 16:08:52.960 D/Mono    ( 6505): GC_TAR_BRIDGE bridges 181 objects 46845 opaque 38136 colors 181 colors-bridged 181 colors-visible 181 xref 19 cache-hit 0 cache-semihit 0 cache-miss 0 setup 0.04ms tarjan 11.86ms scc-setup 0.55ms gather-xref 0.02ms xref-setup 0.12ms cleanup 0.50ms
05-08 16:08:52.960 D/Mono    ( 6505): GC_BRIDGE: Complete, was running for 19.18ms
05-08 16:08:52.960 D/Mono    ( 6505): GC_MINOR: (Nursery full) time 20.60ms, stw 25.46ms promoted 1391K major size: 7008K in use: 6269K los size: 5120K in use: 3854K
05-08 16:08:52.964 E/AppCenterCrashes( 6505): Unhandled Exception from source=AndroidEnvironment
05-08 16:08:52.964 E/AppCenterCrashes( 6505): System.Reflection.AmbiguousMatchException: Ambiguous match found.
05-08 16:08:52.964 E/AppCenterCrashes( 6505):   at System.RuntimeType.GetPropertyImpl (System.String name, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, System.Type returnType, System.Type[] types, System.Reflection.ParameterModifier[] modifiers) [0x00061] in <f32579baafc1404fa37ba3ec1abdc0bd>:0 
05-08 16:08:52.964 E/AppCenterCrashes( 6505):   at System.Type.GetProperty (System.String name) [0x0000e] in <f32579baafc1404fa37ba3ec1abdc0bd>:0 
05-08 16:08:52.964 E/AppCenterCrashes( 6505):   at Xamarin.Forms.BindingExpression.SetupPart (System.Reflection.TypeInfo sourceType, Xamarin.Forms.BindingExpression+BindingExpressionPart part) [0x00221] in D:\a\1\s\Xamarin.Forms.Core\BindingExpression.cs:341 
05-08 16:08:52.964 E/AppCenterCrashes( 6505):   at Xamarin.Forms.BindingExpression.ApplyCore (System.Object sourceObject, Xamarin.Forms.BindableObject target, Xamarin.Forms.BindableProperty property, System.Boolean fromTarget) [0x000d7] in D:\a\1\s\Xamarin.Forms.Core\BindingExpression.cs:130 
05-08 16:08:52.964 E/AppCenterCrashes( 6505):   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 
05-08 16:08:52.964 E/AppCenterCrashes( 6505):   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 
05-08 16:08:52.964 E/AppCenterCrashes( 6505):   at Xamarin.Forms.BindableObject.SetBinding (Xamarin.Forms.BindableProperty targetProperty, Xamarin.Forms.BindingBase binding, System.Boolean fromStyle) [0x0008b] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:316 
05-08 16:08:52.964 E/AppCenterCrashes( 6505):   at Xamarin.Forms.BindableObject.SetBinding (Xamarin.Forms.BindableProperty targetProperty, Xamarin.Forms.BindingBase binding) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:94 
05-08 16:08:52.964 E/AppCenterCrashes( 6505):   at MHWorldCompanion.Core.Pages.WeaponSelectionPage+<InitializeComponent>_anonXamlCDataTemplate_75.LoadDataTemplate () [0x001f2] in <2bb6b8e8a7094c3ea0df28233dbe1b64>:0 
05-08 16:08:52.964 E/AppCenterCrashes( 6505):   at Xamarin.Forms.ElementTemplate.CreateContent () [0x00026] in D:\a\1\s\Xamarin.Forms.Core\ElementTemplate.cs:82 
05-08 16:08:52.964 E/AppCenterCrashes( 6505):   at DLToolkit.Forms.Controls.FlowListViewInternalCell.UpdateData () [0x001b1] in <5d4a24d63abc402db6897eb2bcac9fee>:0 
05-08 16:08:52.964 E/AppCenterCrashes( 6505):   at DLToolkit.Forms.Controls.FlowListViewInternalCell.OnBindingContextChanged () [0x00006] in <5d4a24d63abc402db6897eb2bcac9fee>:0 
05-08 16:08:52.964 E/AppCenterCrashes( 6505):   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:477 
05-08 16:08:52.964 E/AppCenterCrashes( 6505):   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) [0x00122] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:636 
05-08 16:08:52.964 E/AppCenterCrashes( 6505):   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:426 
05-08 16:08:52.964 E/AppCenterCrashes( 6505):   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:583 
05-08 16:08:52.964 E/AppCenterCrashes( 6505):   at Xamarin.Forms.BindableObject.SetValue (Xamarin.Forms.BindableProperty property, System.Object value) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:99 
05-08 16:08:52.964 E/AppCenterCrashes( 6505):   at Xamarin.Forms.BindableObject.set_BindingContext (System.Object value) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:25 
05-08 16:08:52.964 E/AppCenterCrashes( 6505):   at Xamarin.Forms.Internals.TemplatedItemsList`2[TView,TItem].UpdateContent (TItem content, System.Int32 index, System.Object item) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\TemplatedItemsList.cs:614 
05-08 16:08:52.964 E/AppCenterCrashes( 6505):   at Xamarin.Forms.Internals.TemplatedItemsList`2[TView,TItem].ActivateContent (System.Int3
05-08 16:08:52.969 D/Mono    ( 6505): Assembly Ref addref Microsoft.AppCenter.Crashes[0xa474ea00] -> System.Core[0xa4419140]: 14
[0:] AndroidEnvironment.UnhandledExceptionRaiser: System.Reflection.AmbiguousMatchException: Ambiguous match found.
  at System.RuntimeType.GetPropertyImpl (System.String name, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, System.Type returnType, System.Type[] types, System.Reflection.ParameterModifier[] modifiers) [0x00061] in <f32579baafc1404fa37ba3ec1abdc0bd>:0 
  at System.Type.GetProperty (System.String name) [0x0000e] in <f32579baafc1404fa37ba3ec1abdc0bd>:0 
  at Xamarin.Forms.BindingExpression.SetupPart (System.Reflection.TypeInfo sourceType, Xamarin.Forms.BindingExpression+BindingExpressionPart part) [0x00221] in D:\a\1\s\Xamarin.Forms.Core\BindingExpression.cs:341 
  at Xamarin.Forms.BindingExpression.ApplyCore (System.Object sourceObject, Xamarin.Forms.BindableObject target, Xamarin.Forms.BindableProperty property, System.Boolean fromTarget) [0x000d7] in D:\a\1\s\Xamarin.Forms.Core\BindingExpression.cs:130 
  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.SetBinding (Xamarin.Forms.BindableProperty targetProperty, Xamarin.Forms.BindingBase binding, System.Boolean fromStyle) [0x0008b] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:316 
  at Xamarin.Forms.BindableObject.SetBinding (Xamarin.Forms.BindableProperty targetProperty, Xamarin.Forms.BindingBase binding) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:94 
  at MHWorldCompanion.Core.Pages.WeaponSelectionPage+<InitializeComponent>_anonXamlCDataTemplate_75.LoadDataTemplate () [0x001f2] in <2bb6b8e8a7094c3ea0df28233dbe1b64>:0 
  at Xamarin.Forms.ElementTemplate.CreateContent () [0x00026] in D:\a\1\s\Xamarin.Forms.Core\ElementTemplate.cs:82 
  at DLToolkit.Forms.Controls.FlowListViewInternalCell.UpdateData () [0x001b1] in <5d4a24d63abc402db6897eb2bcac9fee>:0 
  at DLToolkit.Forms.Controls.FlowListViewInternalCell.OnBindingContextChanged () [0x00006] in <5d4a24d63abc402db6897eb2bcac9fee>:0 
  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:477 
  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) [0x00122] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:636 
  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:426 
  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:583 
  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 Xamarin.Forms.Internals.TemplatedItemsList`2[TView,TItem].UpdateContent (TItem content, System.Int32 index, System.Object item) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\TemplatedItemsList.cs:614 
  at Xamarin.Forms.Internals.TemplatedItemsList`2[TView,TItem].ActivateContent (System.Int32 index, System.Object item) [0x00038] in D:\a\1\s\Xamarin.Forms.Core\TemplatedItemsList.cs:536 
  at Xamarin.Forms.Internals.TemplatedItemsList`2[TView,TItem].CreateContent (System.Int32 index, System.Object item, System.Boolean insert) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\TemplatedItemsList.cs:543 
  at Xamarin.Forms.Internals.TemplatedItemsList`2[TView,TItem].GetOrCreateContent (System.Int32 index, System.Object item) [0x00023] in D:\a\1\s\Xamarin.Forms.Core\TemplatedItemsList.cs:602 
  at Xamarin.Forms.Internals.TemplatedItemsList`2[TView,TItem].get_Item (System.Int32 index) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\TemplatedItemsList.cs:337 
  at Xamarin.Forms.Platform.Android.ListViewAdapter.GetCellsFromPosition (System.Int32 position, System.Int32 take) [0x0003b] in D:\a\1\s\Xamarin.Forms.Platform.Android\Renderers\ListViewAdapter.cs:516 
  at Xamarin.Forms.Platform.Android.ListViewAdapter.GetCellForPosition (System.Int32 position) [0x00000] in D:\a\1\s\Xamarin.Forms.Platform.Android\Renderers\ListViewAdapter.cs:438 
  at Xamarin.Forms.Platform.Android.ListViewAdapter.GetView (System.Int32 position, Android.Views.View convertView, Android.Views.ViewGroup parent) [0x00081] in D:\a\1\s\Xamarin.Forms.Platform.Android\Renderers\ListViewAdapter.cs:216 
  at Android.Widget.BaseAdapter.n_GetView_ILandroid_view_View_Landroid_view_ViewGroup_ (System.IntPtr jnienv, System.IntPtr native__this, System.Int32 position, System.IntPtr native_convertView, System.IntPtr native_parent) [0x00018] in <25661073a35344a89f215a4cf81af37c>:0 
  at (wrapper dynamic-method) System.Object.1a045c58-a8db-46df-873a-24a335f32e3d(intptr,intptr,int,intptr,intptr). IsTerminating: False

@Sebastian1989101
Copy link
Author

Sebastian1989101 commented May 8, 2018

Seems like this is caused by Source={x:Reference Page} within the binding. As soon as I remove this, the page "works" (well my Button does not work because it is within a ListView and I need a Command from the Page DataContext).

Edit: Seems like to work on the other hand if I use the name of the list itself instead of the whole page. Well this will be a lot of work to change this in 19 apps with multiple pages and this is used quit often in my apps. :/

@StephaneDelcroix
Copy link
Member

@Sebastian1989101 as you isolated the issue, could you please attach a small sample project triggering the issue ?

This looks serious, we should address this pretty quickly

@StephaneDelcroix StephaneDelcroix added the s/needs-repro ❔ This reported issue doesn't include a sample project reproducing the issue. Please provide one. label May 9, 2018
@StephaneDelcroix StephaneDelcroix moved this from New to Needs Info in Triage May 9, 2018
@StephaneDelcroix StephaneDelcroix added this to Ready in v3.0.0 via automation May 9, 2018
@bholmes bholmes added this to the 3.0.0 milestone May 10, 2018
@adamped
Copy link
Contributor

adamped commented May 11, 2018

@StephaneDelcroix I'm getting this on Android and iOS with
var content = this.ItemTemplate.CreateContent();

I'm manually calling this, because I am using a bindable repeater, but I notice the same line is called in the StackTrace's above.

at Xamarin.Forms.ElementTemplate.CreateContent () [0x00026] in D:\a\1\s\Xamarin.Forms.Core\ElementTemplate.cs:82

My BindableRepeater has this property

public DataTemplate ItemTemplate
{
    get { return (DataTemplate)this.GetValue(ItemTemplateProperty); }
    set { this.SetValue(ItemTemplateProperty, value); }
}

And the DataTemplate is loaded by defining it in XAML.

Actually this error seems to be trashing most of my ListViews too.

@adamped
Copy link
Contributor

adamped commented May 11, 2018

@StephaneDelcroix - can confirm using Source={x:Reference Page} in the DataTemplate is the cause of this issue.

@bidy
Copy link

bidy commented May 11, 2018

Similar bug here:
Sine update to Xamarin.Forms 3.0 I get loads of 'System.Reflection.AmbiguousMatchException: Ambiguous match found.' in this line of the compiler generates g.cs files:
private void InitializeComponent() { global::Xamarin.Forms.Xaml.Extensions.LoadFromXaml(this, typeof(LabeledControl)); }

@Nerves82
Copy link

Nerves82 commented May 11, 2018

I am getting this as well. Any Xaml that has a bindable property in it throws this exception in its InitializeComponent method - LoadFromXaml.

private void InitializeComponent() {
global::Xamarin.Forms.Xaml.Extensions.LoadFromXaml(this, typeof(MainMenuPage));
}
screen shot 2018-05-11 at 08 57 14
screen shot 2018-05-11 at 08 56 58

@StephaneDelcroix
Copy link
Member

I can't reproduce the issue with the following xaml

<ListView x:Name="xRefToPage">
            <ListView.ItemTemplate>
                <DataTemplate>
                    <ViewCell><Label Text="{Binding Source={x:Reference Page}}"/></ViewCell>
                </DataTemplate>
            </ListView.ItemTemplate>
        </ListView>

could you please attach a sample project ? or @adamped

@Nerves82
Copy link

Nerves82 commented May 11, 2018

Here is a new project that reproduces the exception. This is with a fresh install of VSMac on the stable channel FYI.

crashfix.zip
screen shot 2018-05-11 at 09 08 53
screen shot 2018-05-11 at 09 14 54

=== Visual Studio Community 2017 for Mac ===

Version 7.5 (build 1254)
Installation UUID: 9043ce4f-9f6a-4727-a2ad-b529b98cc62d
Runtime:
Mono 5.10.1.47 (2017-12/8eb8f7d5e74) (64-bit)
GTK+ 2.24.23 (Raleigh theme)
Xamarin.Mac 4.4.0.36 (master / 0c7c49a6)

Package version: 510010047

=== NuGet ===

Version: 4.3.1.4445

=== .NET Core ===

Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
2.0.5
2.0.4
2.0.0
SDK: /usr/local/share/dotnet/sdk/2.1.4/Sdks
SDK Versions:
2.1.4
2.1.3
2.0.0
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/5.10.1/lib/mono/msbuild/15.0/bin/Sdks

=== Xamarin.Profiler ===

Version: 1.6.2
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

=== Xamarin.Android ===

Version: 8.3.0.19 (Visual Studio Community)
Android SDK: /Users/tk421/Library/Developer/Xamarin/android-sdk-macosx
Supported Android versions:
5.0 (API level 21)
5.1 (API level 22)
6.0 (API level 23)
7.0 (API level 24)
7.1 (API level 25)
8.0 (API level 26)
8.1 (API level 27)

SDK Tools Version: 26.1.1
SDK Platform Tools Version: 27.0.1
SDK Build Tools Version: 26.0.3

Java SDK: /usr
java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)

Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

=== Apple Developer Tools ===

Xcode 9.3 (14154)
Build 9E145

=== Xamarin.Mac ===

Version: 4.4.1.176 (Visual Studio Community)

=== Xamarin.iOS ===

Version: 11.10.1.177 (Visual Studio Community)
Hash: 7e782c1e
Branch: d15-7
Build date: 2018-04-25 15:27:13-0400

=== Xamarin Inspector ===

Version: 1.4.0
Hash: b3f92f9
Branch: master
Build date: Fri, 19 Jan 2018 22:00:34 GMT
Client compatibility: 1

=== Build Information ===

Release ID: 705001254
Git revision: 498923ea36d2c7fe440c4e4b8cfb75bd50bbd748
Build date: 2018-05-05 10:35:24-04
Xamarin addins: 219f1c4943b4693b837b4173dd10ea982a47c852
Build lane: monodevelop-lion-d15-7

=== Operating System ===

Mac OS X 10.13.4
Darwin 17.5.0 Darwin Kernel Version 17.5.0
Fri Apr 13 19:32:32 PDT 2018
root:xnu-4570.51.2~1/RELEASE_X86_64 x86_64

@adamped
Copy link
Contributor

adamped commented May 12, 2018

@StephaneDelcroix the name needs to be attached to the page not an element in the page.

<ContentPage x:Name="Page" …. >
    <ListView>
            <ListView.ItemTemplate>
                <DataTemplate>
                    <ViewCell><Label Text="{Binding Source={x:Reference Page}}"/></ViewCell>
                </DataTemplate>
            </ListView.ItemTemplate>
        </ListView>
</ContentPage>

@StephaneDelcroix
Copy link
Member

@adamped I got that part, but thanks.

I'm about to try @Nerves82 repro

@StephaneDelcroix
Copy link
Member

@Nerves82 your repro is incomplete. also, from the screenshot, it looks like an intelisense problem, and not something preventing a build. am i wrong ?

@Nerves82
Copy link

@StephaneDelcroix Yes, another wonderful (and not at all frustrating) bug in VSMac. The files are in the project but the .csprog file does not include them no matter how many times they are added to the project. Just add BasePage.xaml, BasePage.xaml.cs and BasePageViewModel to the project.

@StephaneDelcroix
Copy link
Member

@Nerves82 you can be frustrated, or you can fix your .csproj. here's a working version for you

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>netstandard2.0</TargetFramework>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Xamarin.Forms" Version="3.0.0.446417" />
  </ItemGroup>

</Project>

@Nerves82
Copy link

@StephaneDelcroix Yep. Been there, done that. Many, many, many times. And yet still VSMac does not save the .csproj file and restarting VSMac opens the project with those files missing. But that is another bug for another thread.

@StephaneDelcroix
Copy link
Member

@Nerves82 your problem seems like an Ambiguous match in intellisense, not at runtime. could you confirm ?

Also, even with BasePage in, your project throws NRE at multiple places.

@StephaneDelcroix
Copy link
Member

@adamped @Sebastian1989101 I still need a valid repro for this.

@Nerves82
Copy link

@StephaneDelcroix It acted like more then intelligence as it would prevent the project from compiling. I just tried to create another new Forms project and pull in those 3 files with the same issue. VSMac seems to keep overriding the .csproj file so the BasePage.xaml never gets included.

@Sebastian1989101
Copy link
Author

@StephaneDelcroix After a few more tests, it might be more a Problem combined with MvvmCross. Because every repository of mine that was affected by this, uses MvvmCross (but it works with XF 2.5). I guess I need a bit more time to find the real source of this. I just thought on first tests that Xamarin.Forms 3.0 was the problem because that was everything I changed.

@Nerves82
Copy link

@Sebastian1989101 I think I can eliminate that possibility. I don't use MVVMCross but was experiencing the issue. My projects are Xamarin Forms with .NETStandard 2.0 for UWP, iOS and Android.

@ryanharding
Copy link

ryanharding commented May 21, 2018

Hopefully this helps some people. ( @MelbourneDeveloper )

Was getting the same Ambiguous exception on my content pages, by adding
[XamlCompilation(XamlCompilationOptions.Compile)]
above the class of my content page the exception went away.

e.g.

namespace xxxxx
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class xxxxView : ContentPage
{

@StephaneDelcroix
Copy link
Member

@ryanharding indeed, that AmbiguousMatch only happen when runtime-inflating XAML

@csstrunt
Copy link

@StephaneDelcroix I put together a very simple example project showing the issue (no mvvmcross here!).
App4.zip

It produces 3 AmbiguousMatchExceptions:
System.Reflection.AmbiguousMatchException: Ambiguous match found.
System.Reflection.AmbiguousMatchException: Ambiguous match found.
System.Reflection.AmbiguousMatchException: Ambiguous match found.

Interestingly enough, the ListView by itself does NOT cause the issue. Only in conjunction with an enclosing StackLayout (or probably some other similar Layout?) the Exception gets thrown. Even more interesting is the fact that the more controls we add to the Stacklayout, the more Exceptions get thrown as I put down in the comments of my xaml.

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:local="clr-namespace:App4"
             x:Class="App4.MainPage"
             
             >

   <StackLayout>

      <!--If the ListView is NOT enclosed by a StackLayout (and no other controls are shown along the ListView), there is NO Ambiguous Exception-->
      <ListView x:Name="MyListView">
         <ListView.ItemTemplate>
            <DataTemplate>
               <ViewCell>
                  <Label Text="Some arbitrary text will do; no text binding required"/>
               </ViewCell>
            </DataTemplate>
         </ListView.ItemTemplate>
      </ListView>

      <!--If this Label is commented out, there is one Ambiguous Exception less shown in the Output Window ... ???-->
      <Label Text="Sittin on the dock of the Stacklayout"/>

      <!--If this button is commented out, there is one Ambiguous Exception less shown in the Output Window ... ???-->
      <Button Text="I'm just a button whose intentions are good ..."/>

   </StackLayout>
</ContentPage>

Hope that helps in reproducing and narrowing down the issue. Good luck!
PS: I'm using Xamarin.Forms 3.0.0.446417

@StephaneDelcroix
Copy link
Member

StephaneDelcroix commented May 21, 2018 via email

@bholmes bholmes removed the 3.0.0 label May 22, 2018
@samhouts samhouts moved this from In Progress to Done in v3.0.0 May 23, 2018
Triage automation moved this from Ready For Work to Closed May 23, 2018
@rkotulan
Copy link

Any estimation for release?

@godrose
Copy link

godrose commented May 30, 2018

The latest pre-release has the same issue

@duckwaffle
Copy link

@StephaneDelcroix any idea of when your changes to fix this issue will be released? I even went so far as to see about getting the "nightly" build from MyGet, but it seems that the last time that was released was a few days before your PR was merged (which, I mean, you really ought to re-name the MyGet feed, as it's not really "nightly" now, is it?).

@mgwalm
Copy link

mgwalm commented May 31, 2018

Ive got VS 15.2.7 and using xf 3.0.0.482510. Just updated to both today(May 31). An using Win 10 build1809.

It is still happening. As said above it is a RUNTIME exception on the LoadFromXaml in the .g.cs. The exception gets swallowed by XF.

Im only using normal basic binding, eg, <Entry x:Name="Pin1" Text="{Binding Pin1, Mode=TwoWay}"

However, the view appears to work after the exception.

@mgwalm
Copy link

mgwalm commented May 31, 2018

Ive just checked - I have 11 basic bindings on a form and the exception gets thrown 11 times.

@jamers99
Copy link

jamers99 commented Jun 5, 2018

@ryanharding that fixed it! Thanks for the suggestion.

@nadjibus
Copy link

Getting it even with [XamlCompilation(XamlCompilationOptions.Compile)] (both page and assembly level)

@samhouts samhouts removed this from Closed in Triage Jun 22, 2018
@vodevil
Copy link

vodevil commented Aug 1, 2018

I just migrate from Xamarin Forms 2.5 to 3.1.0 and everything failed with AmbiguousMatchException at application start :(

@godrose
Copy link

godrose commented Aug 1, 2018 via email

@alicint
Copy link

alicint commented Sep 26, 2018

I'm getting this error since I upgraded from Xamarin 2.5 to 3.2. I removed all the "Source={x:Reference Page}}" in my xaml file but still the error is there. any ideas what else can be the cause?

@StephaneDelcroix
Copy link
Member

@alicint please open a new issue, with a reproduction. thx

@txarito
Copy link

txarito commented Dec 10, 2018

Hello, i'm getting this error on new Project.
VS2017 15.9.3, Xamarin Forms 3.4.0.1008975, .net Estándar 2.0
Page definition:
<ContentPage x:Name="ViewX"...>
In a control:
Parent="{x:Reference ViewX}"

Remove last line solve runtime error, but obviously it's doens't works as expected.

Any workaround, solution?.

Many thanks

@StephaneDelcroix
Copy link
Member

@txarito please open a new issue, with a reproduction. thx

@EmilAlipiev
Copy link
Contributor

it is strange but this error was caused by livesharp for me. as referenced link

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
No open projects
v3.0.0
  
Done
Development

No branches or pull requests