Bug 21154 - binding exception on Android page the 2nd time you load the page
Summary: binding exception on Android page the 2nd time you load the page
Status: RESOLVED FIXED
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 1.1.0
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2014-07-07 13:47 UTC by Jon Goldberger [MSFT]
Modified: 2016-03-15 19:18 UTC (History)
6 users (show)

Tags: AC
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Jon Goldberger [MSFT] 2014-07-07 13:47:55 UTC
I am getting this exception when I try to re-load a page (SchedulePage.cs) a second time in my Android app:

Exception has been thrown by the target of an invocation.
>at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters) [0x00000] in <filename unknown>:0
>at System.Activator.CreateInstance (System.Type type, Boolean nonPublic) [0x00000] in <filename unknown>:0
>at System.Activator.CreateInstance (System.Type type) [0x00000] in <filename unknown>:0
>at Xamarin.Forms.Registrar`1[Xamarin.Forms.IRegisterable].InnerGetHandler (System.Type t) [0x00000] in <filename unknown>:0
>at Xamarin.Forms.Registrar`1[Xamarin.Forms.IRegisterable].GetHandler (System.Type type) [0x00000] in <filename unknown>:0
>at Xamarin.Forms.Registrar`1[Xamarin.Forms.IRegisterable].GetHandler[IVisualElementRenderer] (System.Type type) [0x00000] in <filename unknown>:0
>at Xamarin.Forms.Platform.Android.RendererFactory.GetRenderer (Xamarin.Forms.VisualElement view) [0x00000] in <filename unknown>:0
>at Xamarin.Forms.Platform.Android.TabbedRenderer.SwitchContent (Xamarin.Forms.Page view) [0x00000] in <filename unknown>:0
>at Xamarin.Forms.Platform.Android.TabbedRenderer.OnElementPropertyChanged (System.Object sender, System.ComponentModel.PropertyChangedEventArgs e) [0x00000] in <filename unknown>:0
>at (wrapper delegate-invoke) <Module>:invoke_void__this___object_PropertyChangedEventArgs (object,System.ComponentModel.PropertyChangedEventArgs)
>at (wrapper delegate-invoke) <Module>:invoke_void__this___object_PropertyChangedEventArgs (object,System.ComponentModel.PropertyChangedEventArgs)
>at Xamarin.Forms.BindableObject.OnPropertyChanged (System.String propertyName) [0x00000] in <filename unknown>:0
>at Xamarin.Forms.MultiPage`1[Xamarin.Forms.Page].OnPropertyChanged (System.String propertyName) [0x00000] in <filename unknown>:0
>at Xamarin.Forms.MultiPage`1[Xamarin.Forms.Page].set_CurrentPage (Xamarin.Forms.Page value) [0x00000] in <filename unknown>:0
>at Xamarin.Forms.MultiPage`1[Xamarin.Forms.Page].UpdateCurrentPage () [0x00000] in <filename unknown>:0
>at Xamarin.Forms.MultiPage`1[Xamarin.Forms.Page].OnPropertyChanged (System.String propertyName) [0x00000] in <filename unknown>:0
>at Xamarin.Forms.BindableObject+<>c__DisplayClass1.<SetValueCore>b__0 () [0x00000] in <filename unknown>:0
>at Xamarin.Forms.BindableObject.SetValueCore (Xamarin.Forms.BindableProperty property, System.Object value, Boolean >-clearBindings, Boolean raiseOnEqual, Boolean checkaccess) [0x00000] in <filename unknown>:0
>at Xamarin.Forms.BindableObject.SetValue (Xamarin.Forms.BindableProperty property, System.Object value, Boolean checkaccess) [0x00000] in <filename unknown>:0
>at Xamarin.Forms.BindableObject.SetValue (Xamarin.Forms.BindableProperty property, System.Object value) [0x00000] in <filename unknown>:0
>at Xamarin.Forms.MultiPage`1[Xamarin.Forms.Page].set_SelectedItem (System.Object value) [0x00000] in <filename unknown>:0
>at Xamarin.Forms.MultiPage`1[Xamarin.Forms.Page].Reset () [0x00000] in <filename unknown>:0
>at Xamarin.Forms.MultiPage`1[Xamarin.Forms.Page].OnTemplatedItemsChanged (System.Object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) [0x00000] in <filename unknown>:0
>at Xamarin.Forms.TemplatedItemsList`2[Xamarin.Forms.MultiPage`1[Xamarin.Forms.Page],Xamarin.Forms.Page].OnCollectionChanged (System.Collections.Specialized.NotifyCollectionChangedEventArgs e) [0x00000] in <filename unknown>:0
>at Xamarin.Forms.TemplatedItemsList`2[Xamarin.Forms.MultiPage`1[Xamarin.Forms.Page],Xamarin.Forms.Page].OnProxyCollectionChanged (System.Object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e, Boolean fixWindows) [0x00000] in <filename unknown>:0
>at Xamarin.Forms.TemplatedItemsList`2[Xamarin.Forms.MultiPage`1[Xamarin.Forms.Page],Xamarin.Forms.Page].OnProxyCollectionChanged (System.Object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) [0x00000] in <filename unknown>:0
>at Xamarin.Forms.TemplatedItemsList`2[Xamarin.Forms.MultiPage`1[Xamarin.Forms.Page],Xamarin.Forms.Page].OnItemsSourceChanged (Boolean fromGrouping) [0x00000] in <filename unknown>:0
>at Xamarin.Forms.TemplatedItemsList`2[Xamarin.Forms.MultiPage`1[Xamarin.Forms.Page],Xamarin.Forms.Page].BindableOnPropertyChanged (System.Object sender, System.ComponentModel.PropertyChangedEventArgs e) [0x00000] in <filename unknown>:0
>at (wrapper delegate-invoke) <Module>:invoke_void__this___object_PropertyChangedEventArgs (object,System.ComponentModel.PropertyChangedEventArgs)
>at (wrapper delegate-invoke) <Module>:invoke_void__this___object_PropertyChangedEventArgs (object,System.ComponentModel.PropertyChangedEventArgs)
>at Xamarin.Forms.BindableObject.OnPropertyChanged (System.String propertyName) [0x00000] in <filename unknown>:0
>at Xamarin.Forms.MultiPage`1[Xamarin.Forms.Page].OnPropertyChanged (System.String propertyName) [0x00000] in <filename unknown>:0
>at Xamarin.Forms.BindableObject+<>c__DisplayClass1.<SetValueCore>b__0 () [0x00000] in <filename unknown>:0
>at Xamarin.Forms.BindableObject.SetValueCore (Xamarin.Forms.BindableProperty property, System.Object value, Boolean clearBindings, Boolean raiseOnEqual, Boolean checkaccess) [0x00000] in <filename unknown>:0
>at Xamarin.Forms.BindableObject.SetValue (Xamarin.Forms.BindableProperty property, System.Object value, Boolean checkaccess) [0x00000] in <filename unknown>:0
>at Xamarin.Forms.BindableObject.SetValue (Xamarin.Forms.BindableProperty property, System.Object value) [0x00000] in <filename unknown>:0
>at Xamarin.Forms.MultiPage`1[Xamarin.Forms.Page].set_ItemsSource (IEnumerable value) [0x00000] in <filename unknown>:0
>at ClevelandPlays.Mobile.Pages.SchedulePage.<.ctor>b__8 (ClevelandPlays.Mobile.ViewModels.ScheduleViewModel vm) [0x00002] in c:\Code\ClevelandPlays\ClevelandPlays.Mobile\ClevelandPlays.Mobile\Pages\SchedulePage.cs:42


Here is a link to my entire solution, zipped up in a OneDrive folder:
http://1drv.ms/1qvCppW

You should be able to F5 and run the app against my dev web service which is running in Azure. To get to the Schedule page, click "Scores & Standings" from the home page, and then select a league and click "Schedule". If you back out of that page, and then go back in, you will see the exception written with a Debug statement.

I am actually seeing this same type of error on the "Standings" page as well. If I eat the exception, it continues on and loads the page without further problem, but I would rather not have to eat exceptions all over my app.



Here is the usual VS Info:

Microsoft Visual Studio Premium 2013
Version 12.0.30501.00 Update 2
Microsoft .NET Framework
Version 4.5.51641

Installed Version: Premium

Xamarin 3.0.54.0 (d3cf238e3845e930e312b6ec9b4c6c5437c33067)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android

Xamarin.Android 4.12.4.20 (b5dc5ce91305e19de51d71a1122c109719c4bc34)
Visual Studio plugin to enable development for Xamarin.Android.

Xamarin.iOS 3.0.54.0 (d3cf238e3845e930e312b6ec9b4c6c5437c33067)
Visual Studio extension to enable development for Xamarin.iOS

I am running Xamarin.Forms version 1.1.0.6201. I cannot upgrade to the 1.1.1.6206 build because it breaks my toolbar items in Android.
Comment 2 Jon Goldberger [MSFT] 2014-07-07 13:49:46 UTC
I was able to reproduce the above in both Xamarin.Forms 1.1.0.6201 and 1.1.1.6206 for the Android app.
Comment 3 Ram Chandra 2014-08-26 09:28:39 UTC
I have tried to reproduce this issue but I am unable to open the project. I have downloaded the attached project and when I try to open that project, I am getting a windows security popup, which is asking for TFS credentials .

Screencast: http://www.screencast.com/t/2eeFltIqdqU

If it is possible, could you please provide the credentials? So, that we can reproduce this issue at our end.

Environment Info:

Windows 7
Microsoft Visual Studio Professional 2013
Version 12.0.30501.00 Update 2
Microsoft .NET Framework
Version 4.5.50938
Installed Version: Professional
Xamarin   3.5.49.0 (dc4abb7f6f2c86efc586b4b5072d18d5f9b3ea06)
Comment 4 Jon Goldberger [MSFT] 2014-08-26 14:18:04 UTC
Try answering "No" when asked if you want to contact the TFS server. Doing this, I am able to load the test project.

Changing status back to New
Comment 5 Stephane Delcroix 2015-05-28 05:13:58 UTC
The solution currently hosted on the one drive does not compile.

Could you please provide a working version, targeted against a recent XF release, and ideally stripped down to showcase the bug instead of a full application?

Thanks a lot
Comment 6 Jason Smith [MSFT] 2016-03-15 19:18:16 UTC
Thank you for taking the time to submit this report. After reviewing the description of this bug, we no longer believe it affects the current version of Xamarin.Forms. If you are still experiencing the issue after updating your packages, please reopen this report with an attached reproduction.
 
For your convenience, we have created some reproduction best practices viewable here: https://gist.github.com/jassmith/92405c300e54a01dcc6d

Warm regards,
Xamarin Forms Team