Xamarin.forms: Forms 3.0: System.Reflection.AmbiguousMatchException

Created on 8 May 2018  Â·  59Comments  Â·  Source: xamarin/Xamarin.Forms

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
binding ⛓ netstandard regression bug

Most helpful comment

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
{

All 59 comments

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

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. :/

@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 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.

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

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)); }

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

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

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

@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>

@adamped I got that part, but thanks.

I'm about to try @Nerves82 repro

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

@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.

@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>

@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.

@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.

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

@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.

@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.

@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.

@Nerves82 the issue you describe here and in your repo is the same exception but a different problem. You did not describe the problem from the topic where Source={x:Reference Page}, where Page is the x:Name of the page itself, triggers the exception.

@Sebastian1989101 Ya that is correct. FWIW, the issues I was getting was the error in the build console: "System.Reflection.AmbiguousMatchException: Ambiguous match found", the intellisense error pictured above and a System.Exception breakpoint at

private void InitializeComponent() {
global::Xamarin.Forms.Xaml.Extensions.LoadFromXaml(this, typeof(SOMECLASS)); <-- this line
}

for any class that contained xaml with a binding (e.g. Text = "{Binding SomeText}").

@StephaneDelcroix its definitely a runtime issue, but I am having trouble isolating it, as a new project doesn't throw the error, but my existing one does all over the place.

@adamped could you email me your project ?

@StephaneDelcroix - sorry, wish I could, but its a high profile client, and I'm bound by an NDA.

Hi, I am having the same issue and breaking at the same point as @Nerves82 .

Here's my 10 cents to try help narrow down the issue.

Just upgraded to XF 3.0
my PCL is referencing the following nuget packages
"Autofac" Version="4.8.0"
"Microsoft.AppCenter.Analytics" Version="1.6.0"
"Microsoft.AppCenter.Crashes" Version="1.6.0"
"Microsoft.Azure.Mobile.Client" Version="4.0.2"
"Microsoft.Azure.Mobile.Client.SQLiteStore" Version="4.0.2"
"Plugin.Permissions" Version="3.0.0.8"
"Rg.Plugins.Popup" Version="1.0.4"
"TK.CustomMap" Version="2.0.1"
"WindowsAzure.Storage" Version="9.1.1"
"Xam.Plugin.Connectivity" Version="3.1.1"
"Xam.Plugin.ExternalMaps" Version="4.0.1"
"Xam.Plugin.Geolocator" Version="4.5.0.1"
"Xam.Plugin.Media" Version="3.2.1"
"Xam.Plugins.Settings" Version="4.0.0.7"
"Xamarin.Forms" Version="3.0.0.446417"
"Xamarin.Forms.Maps" Version="3.0.0.446417"

Hopefully we can track down a common environment.

@StephaneDelcroix I have sent you my code by email (at delcroix.org), please check.
or the code is at:
https://github.com/flyingxu/xamarin-bluetooth-le/tree/mvvmcross6

Open BLE.sln and set Samples/BLE.Client.Droid as startup project.
Run it. On the main screen, swipe down to scan for Bluetooth devices.
Hopefully, you have some Bluetooth devices nearby, the item will be added and the app will crash.

The suspicious code is at:

            <ViewCell.ContextActions>
              <MenuItem Command="{Binding Path=BindingContext.DisconnectCommand, Source={x:Reference DevicePage}}"
                        CommandParameter="{Binding .}" IsDestructive="True"
                        Text="Disconnect"/>
            </ViewCell.ContextActions>

If I remove the code, the app runs ok.

@flyingxu I get "Permission denied. Not scanning"

I'm quite sure the issue is not related to bluetooth, could you please try to isolate the problem on a page that doesn't have requirements ? thanks

a quick fix is to allow the app for its bluetooth and location permissions. You can go to Android settings to change the permission

@flyingxu not helping

@Nerves82, @ryanharding, for the issue with IntelliSense (which seems to be a separate issue from the exception at run-time described in the initial description), I would recommend to vote on and follow the Visual Studio Developer Community item where that behavior is under investigation:

https://developercommunity.visualstudio.com/content/problem/245328/xamarin-forms-somepagexamlcs-initializecomponent-s.html

@StephaneDelcroix
On android,

  1. Start debug
  2. Go to android settings to change the permission settings,
  3. Then go back to the app to swipe down to scan

(Don’t start a new debug or download again during the above steps, or the permission setting will be cleared since the app is uninstalled during a new debug)

You can also try iOS, same crash.

We have an Android release on Wednesday and this is looking very bad for us...

We're getting this exception all over the place. The only piece of information we're seeing is that it is happening on the class Grid, and the property is Children. It looks like Grid has multiple Children properties. But, this is only a snippet of information, we have not delved deeply in to this yet.

I tried to downgrade to the previous NuGet but the bugs in that version are far more severe so we have to deploy our app to the customer with exceptions getting thrown all over the place which will seriously impact performance.

@MelbourneDeveloper but in your case, those exceptions are caught, right? so the issue is different from the crash reported here ? if so, please open another issue. I'll look at it

Looks like the problem is Mvvmcross redefining BindingContext ¯\_(ツ)_/¯. Let's see if I can repro that behavior without Mvx...

Is there a way to work around this?

I'm seeing this happen with the SwipeCards control. Very frustrating, nothing I try seems to resolve it.

@StephaneDelcroix the exception is thrown, and then handled. It's not a crash. But, it does cause the debugger to break on the line where the exception is handled. The problem is that gobbling up exceptions eats performance.

@LukeTim @MelbourneDeveloper - if this is the same error that we were getting with the Ambiguous Exception, because we were using MvvmCross, then Stephane has PR'd a fix https://github.com/xamarin/Xamarin.Forms/pull/2766

But its not merged yet.

@adamped , thanks but we are definitely not using MvvmCross.

We have to release our app in two days. @StephaneDelcroix , is there any chance of putting together a patch release? We're not going to have a chance to retest with a new NuGet package unless it's only a very minor change.

@MelbourneDeveloper your issue is definitely different, please open a new ticket, I'll look at fixing that tomorrow.

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
{

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

@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

Thanks for the repro, but we know exactly where and why it happens.

Any estimation for release?

The latest pre-release has the same issue

@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?).

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,

However, the view appears to work after the exception.

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

@ryanharding that fixed it! Thanks for the suggestion.

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

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

You should clean and rebuild. This issue has been fixed in the June version.

On Wed, 1 Aug 2018 at 16:00 vodevil notifications@github.com wrote:

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

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/xamarin/Xamarin.Forms/issues/2632#issuecomment-409566070,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AHbkI3r9wR8pFvWvtRo-hRHTMYmN3gtrks5uMaZcgaJpZM4T27Os
.

>

Best Regards,
Gena

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?

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

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

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

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

Was this page helpful?
0 / 5 - 0 ratings