Bug 24549 - Mono_UnhandledException_internal in 1.2.3.6257 and 1.3.0.6275-pre1
Summary: Mono_UnhandledException_internal in 1.2.3.6257 and 1.3.0.6275-pre1
Status: RESOLVED NOT_REPRODUCIBLE
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 1.3.0
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2014-11-14 22:45 UTC by jens
Modified: 2016-12-20 18:43 UTC (History)
5 users (show)

Tags:
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 NOT_REPRODUCIBLE

Description jens 2014-11-14 22:45:33 UTC
When updating the version of Xamarin.Forms to 1.2.3.6257 or 1.3.0.6275-pre1 for the project at https://github.com/paulpatarinski/ShouldIWashMyCar the following stack trace is produced on executing the Android implementation.  Leaving the version at 1.1.1.6206 works without issue:



System.Diagnostics.Debugger.Mono_UnhandledException_internal () in 
System.Diagnostics.Debugger.Mono_UnhandledException (ex={System.InvalidCastException: Cannot cast from source type to destination type.
at Xamarin.Forms.ImageCell.<.cctor>b__8 (Xamarin.Forms.BindableObject,object,object) <IL 0x00001, 0x0006c>
at Xamarin.Forms.BindableObject.SetValueActual (Xamarin.Forms.BindableProperty,Xamarin.Forms.BindableObject/BindablePropertyContext,object,bool,Xamarin.Forms.BindableObject/SetValueFlags,bool) <IL 0x0004d, 0x0027b>
at Xamarin.Forms.BindableObject.SetValueCore (Xamarin.Forms.BindableProperty,object,Xamarin.Forms.BindableObject/SetValueFlags,Xamarin.Forms.BindableObject/SetValuePrivateFlags) <IL 0x002cb, 0x00daf>
at Xamarin.Forms.BindableObject.SetValueCore (Xamarin.Forms.BindableProperty,object,Xamarin.Forms.BindableObject/SetValueFlags) <IL 0x00005, 0x00067>
at Xamarin.Forms.BindingExpression.ApplyCore (object,Xamarin.Forms.BindableObject,Xamarin.Forms.BindableProperty,bool) <IL 0x001ad, 0x00f9b>
at Xamarin.Forms.BindingExpression.Apply (object,Xamarin.Forms.BindableObject,Xamarin.Forms.BindableProperty) <IL 0x0007e, 0x003bf>
at Xamarin.Forms.Binding.Apply (object,Xamarin.Forms.BindableObject,Xamarin.Forms.BindableProperty) <IL 0x00061, 0x002df>
at Xamarin.Forms.BindableObject.ApplyBindings (object) <IL 0x00035, 0x001bf>
at Xamarin.Forms.BindableObject.BindingContextPropertyBindingPropertyChanged (Xamarin.Forms.BindableObject,object,object) <IL 0x00015, 0x000cb>
at Xamarin.Forms.BindableObject.SetValueActual (Xamarin.Forms.BindableProperty,Xamarin.Forms.BindableObject/BindablePropertyContext,object,bool,Xamarin.Forms.BindableObject/SetValueFlags,bool) <IL 0x000f8, 0x00713>
at Xamarin.Forms.BindableObject.SetValueCore (Xamarin.Forms.BindableProperty,object,Xamarin.Forms.BindableObject/SetValueFlags,Xamarin.Forms.BindableObject/SetValuePrivateFlags) <IL 0x002cb, 0x00daf>
at Xamarin.Forms.BindableObject.SetValue (Xamarin.Forms.BindableProperty,object,bool,bool) <IL 0x00078, 0x00467>
at Xamarin.Forms.BindableObject.SetValue (Xamarin.Forms.BindableProperty,object) <IL 0x00005, 0x00063>
at Xamarin.Forms.BindableObject.set_BindingContext (object) <IL 0x00007, 0x00057>
at Xamarin.Forms.TemplatedItemsList`2<Xamarin.Forms.ItemsView`1<Xamarin.Forms.Cell>, Xamarin.Forms.Cell>.CreateContent (int,object,bool) <0x001bf>
at Xamarin.Forms.TemplatedItemsList`2<Xamarin.Forms.ItemsView`1<Xamarin.Forms.Cell>, Xamarin.Forms.Cell>.GetOrCreateContent (int,object) <0x00107>
at Xamarin.Forms.TemplatedItemsList`2<Xamarin.Forms.ItemsView`1<Xamarin.Forms.Cell>, Xamarin.Forms.Cell>.get_Item (int) <0x000a3>
at Xamarin.Forms.Platform.Android.ListViewAdapter.GetCellsFromPosition (int,int) <IL 0x00044, 0x0026f>
at Xamarin.Forms.Platform.Android.ListViewAdapter.GetCellForPosition (int) <IL 0x00003, 0x0004f>
at Xamarin.Forms.Platform.Android.ListViewAdapter.GetView (int,Android.Views.View,Android.Views.ViewGroup) <IL 0x00046, 0x00323>
at Android.Widget.BaseAdapter.n_GetView_ILandroid_view_View_Landroid_view_ViewGroup_ (intptr,intptr,int,intptr,intptr) [0x0001a] in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.20-series/812ca135/source/monodroid/src/Mono.Android/platforms/android-19/src/generated/Android.Widget.BaseAdapter.cs:460
at (wrapper dynamic-method) object.273abc80-22c8-4600-9a33-354e5e072999 (intptr,intptr,int,intptr,intptr) <IL 0x00023, 0x0005f>
}) in 
object.273abc80-22c8-4600-9a33-354e5e072999 (arg0=0x41bdd120, arg1=0xffffffffbea36de4, arg2=0, arg3=0x0, arg4=0xffffffffbea36dec) in 
Xamarin.Forms.ImageCell.<.cctor>b__8 (bindable={Xamarin.Forms.TextCell}, oldvalue=(null), newvalue={Xamarin.Forms.FileImageSource}) in 
Xamarin.Forms.BindableObject.SetValueActual (property=ImageSource, context={Xamarin.Forms.BindableObject.BindablePropertyContext}, value={Xamarin.Forms.FileImageSource}, currentlyApplying=false, attributes=Xamarin.Forms.BindableObject+SetValueFlags.ClearDynamicResource, silent=false) in 
Xamarin.Forms.BindableObject.SetValueCore (property=ImageSource, value={Xamarin.Forms.FileImageSource}, attributes=Xamarin.Forms.BindableObject+SetValueFlags.ClearDynamicResource, privateAttributes=Xamarin.Forms.BindableObject+SetValuePrivateFlags.CheckAccess) in 
Xamarin.Forms.BindableObject.SetValueCore (property=ImageSource, value={Xamarin.Forms.FileImageSource}, attributes=Xamarin.Forms.BindableObject+SetValueFlags.ClearDynamicResource) in 
Xamarin.Forms.BindingExpression.ApplyCore (sourceObject={Core.ForecastOptionItem}, target={Xamarin.Forms.TextCell}, property=ImageSource, fromTarget=false) in 
Xamarin.Forms.BindingExpression.Apply (sourceObject={Core.ForecastOptionItem}, target={Xamarin.Forms.TextCell}, property=ImageSource) in 
Xamarin.Forms.Binding.Apply (newContext={Core.ForecastOptionItem}, bindObj={Xamarin.Forms.TextCell}, targetProperty=ImageSource) in 
Xamarin.Forms.BindableObject.ApplyBindings (oldContext=(null)) in 
Xamarin.Forms.BindableObject.BindingContextPropertyBindingPropertyChanged (bindable={Xamarin.Forms.TextCell}, oldvalue=(null), newvalue={Core.ForecastOptionItem}) in 
Xamarin.Forms.BindableObject.SetValueActual (property=BindingContext, context={Xamarin.Forms.BindableObject.BindablePropertyContext}, value={Core.ForecastOptionItem}, currentlyApplying=false, attributes=Xamarin.Forms.BindableObject+SetValueFlags.ClearDynamicResource|Xamarin.Forms.BindableObject+SetValueFlags.ClearOneWayBindings, silent=false) in 
Xamarin.Forms.BindableObject.SetValueCore (property=BindingContext, value={Core.ForecastOptionItem}, attributes=Xamarin.Forms.BindableObject+SetValueFlags.ClearDynamicResource|Xamarin.Forms.BindableObject+SetValueFlags.ClearOneWayBindings, privateAttributes=Xamarin.Forms.BindableObject+SetValuePrivateFlags.CheckAccess|Xamarin.Forms.BindableObject+SetValuePrivateFlags.ManuallySet) in 
Xamarin.Forms.BindableObject.SetValue (property=BindingContext, value={Core.ForecastOptionItem}, fromStyle=false, checkAccess=true) in 
Xamarin.Forms.BindableObject.SetValue (property=BindingContext, value={Core.ForecastOptionItem}) in 
Xamarin.Forms.BindableObject.set_BindingContext (value={Core.ForecastOptionItem}) in 
Xamarin.Forms.TemplatedItemsList<Xamarin.Forms.ItemsView<Xamarin.Forms.Cell>,Xamarin.Forms.Cell>.CreateContent (index=0, item={Core.ForecastOptionItem}, insert=false) in 
Xamarin.Forms.TemplatedItemsList<Xamarin.Forms.ItemsView<Xamarin.Forms.Cell>,Xamarin.Forms.Cell>.GetOrCreateContent (index=0, item={Core.ForecastOptionItem}) in 
Xamarin.Forms.TemplatedItemsList<Xamarin.Forms.ItemsView<Xamarin.Forms.Cell>,Xamarin.Forms.Cell>.get_Item (index=0) in 
Xamarin.Forms.Platform.Android.ListViewAdapter.GetCellsFromPosition (position=0, take=1) in 
Xamarin.Forms.Platform.Android.ListViewAdapter.GetCellForPosition (position=0) in 
Xamarin.Forms.Platform.Android.ListViewAdapter.GetView (position=0, convertView=(null), parent=) in 
Android.Widget.BaseAdapter.n_GetView_ILandroid_view_View_Landroid_view_ViewGroup_ (Parameters=) in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.20-series/812ca135/source/monodroid/src/Mono.Android/platforms/android-19/src/generated/Android.Widget.BaseAdapter.cs:460
object.273abc80-22c8-4600-9a33-354e5e072999 (Parameters=) in 
Android.Runtime.JNIEnv.CallVoidMethod (Parameters=) in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.20-series/812ca135/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.g.cs:504
Android.Views.View.Measure (Parameters=) in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.20-series/812ca135/source/monodroid/src/Mono.Android/platforms/android-19/src/generated/Android.Views.View.cs:12241
Xamarin.Forms.Platform.Android.ViewRenderer<Xamarin.Forms.ListView,Android.Widget.ListView>.GetDesiredSize (Parameters=) in 
Xamarin.Forms.Platform.Android.Platform.GetNativeSize (Parameters=) in 
Xamarin.Forms.VisualElement.OnSizeRequest (Parameters=) in 
Xamarin.Forms.VisualElement.GetSizeRequest (Parameters=) in 
Xamarin.Forms.StackLayout.SumOfSizeRequests (Parameters=) in 
Xamarin.Forms.StackLayout.LayoutChildren (Parameters=) in 
Xamarin.Forms.Layout.UpdateChildrenLayout (Parameters=) in 
Xamarin.Forms.Layout.OnSizeAllocated (Parameters=) in 
Xamarin.Forms.VisualElement.SizeAllocated (Parameters=) in 
Xamarin.Forms.VisualElement.SetSize (Parameters=) in 
Xamarin.Forms.VisualElement.set_Bounds (Parameters=) in 
Xamarin.Forms.VisualElement.Layout (Parameters=) in 
Xamarin.Forms.Layout.LayoutChildIntoBoundingRegion (Parameters=) in 
Xamarin.Forms.Page.LayoutChildren (Parameters=) in 
Xamarin.Forms.Page.UpdateChildrenLayout (Parameters=) in 
Xamarin.Forms.Page.OnSizeAllocated (Parameters=) in 
Xamarin.Forms.VisualElement.SizeAllocated (Parameters=) in 
Xamarin.Forms.VisualElement.SetSize (Parameters=) in 
Xamarin.Forms.VisualElement.set_Bounds (Parameters=) in 
Xamarin.Forms.VisualElement.Layout (Parameters=) in 
Xamarin.Forms.MasterDetailPage.set_MasterBounds (Parameters=) in 
Xamarin.Forms.Platform.Android.MasterDetailContainer.OnLayout (Parameters=) in 
Android.Views.ViewGroup.n_OnLayout_ZIIII (Parameters=) in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.20-series/812ca135/source/monodroid/src/Mono.Android/platforms/android-19/src/generated/Android.Views.ViewGroup.cs:3275
object.1463027a-97dd-44c2-a0a8-fd3ea6ff281b (Parameters=) in 
Android.Runtime.JNIEnv.CallVoidMethod (Parameters=) in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.20-series/812ca135/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.g.cs:504
Android.Views.ViewGroup.Layout (Parameters=) in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.20-series/812ca135/source/monodroid/src/Mono.Android/platforms/android-19/src/generated/Android.Views.ViewGroup.cs:3047
Xamarin.Forms.Platform.Android.VisualElementTracker.UpdateLayout (Parameters=) in 
Xamarin.Forms.Platform.Android.MasterDetailRenderer.UpdateLayout (Parameters=) in 
Xamarin.Forms.Platform.Android.VisualElementRenderer<Xamarin.Forms.NavigationPage>.OnLayout (Parameters=) in 
Xamarin.Forms.Platform.Android.NavigationRenderer.OnLayout (Parameters=) in 
Xamarin.Forms.Platform.Android.FormsViewGroup.n_OnLayout_ZIIII (Parameters=) in 
object.9297865b-4eda-4276-94a1-3456b1de6772 (Parameters=) in 
Android.Runtime.JNIEnv.CallNonvirtualVoidMethod (Parameters=) in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.20-series/812ca135/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.g.cs:892
Xamarin.Forms.Platform.Android.FormsViewGroup.MeasureAndLayout (Parameters=) in 
Xamarin.Forms.Platform.Android.VisualElementTracker.UpdateLayout (Parameters=) in 
Xamarin.Forms.Platform.Android.VisualElementRenderer<Xamarin.Forms.NavigationPage>.UpdateLayout (Parameters=) in 
Xamarin.Forms.Platform.Android.Platform.OnLayout (Parameters=) in 
Xamarin.Forms.Platform.Android.PlatformRenderer.OnLayout (Parameters=) in 
Android.Views.ViewGroup.n_OnLayout_ZIIII (Parameters=) in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.20-series/812ca135/source/monodroid/src/Mono.Android/platforms/android-19/src/generated/Android.Views.ViewGroup.cs:3275
object.1463027a-97dd-44c2-a0a8-fd3ea6ff281b (Parameters=) in
Comment 1 Sunil Kumar 2015-01-02 11:17:37 UTC
I have tried to reproduce this issue. I downloaded the attached sample project from link given in bug description. I opened downloaded sample and updated the Xamarin.Forms to 1.3.0.6292. On running Android application, I are getting exception. Here is the screencast for the same: http://www.screencast.com/t/pphK7KUGoTa

Exception: https://gist.github.com/RamChBachkheti/05eb1cd3e31c1cb4b129

Also we are getting the different log in Stack trace which you mentioned in bug description: https://gist.github.com/RamChBachkheti/c75b8a10a409c428b070

Please let me know I am going in right direction or I have to do something else to reproduce this issue.

If it is possible, could you please provide IDE log.
For IDE log: XS->Help->Open Log Directory->IDE.log

Environment info: 
=== Xamarin Studio ===

Version 5.5.4 (build 15)
Installation UUID: a7e29e93-6348-4126-9ebc-b2777c96a552
Runtime:
	Microsoft .NET 4.0.30319.18408
	GTK+ 2.24.22 (MS-Windows theme)
	GTK# 2.12.26

=== Xamarin.Android ===

Version: 4.20.0 (Business Edition)
Android SDK: E:\android-sdk
	Supported Android versions:
		2.1    (API level 7)
		2.2    (API level 8)
		2.3    (API level 10)
		3.1    (API level 12)
		4.0    (API level 14)
		4.0.3  (API level 15)
		4.2    (API level 17)
		4.3    (API level 18)
		4.4    (API level 19)
		4.4.87 (API level 20)
		5.0    (API level 21)
Java SDK: C:\Program Files (x86)\Java\jdk1.6.0_39
java version "1.6.0_39"
Java(TM) SE Runtime Environment (build 1.6.0_39-b04)
Java HotSpot(TM) Client VM (build 20.14-b01, mixed mode)

=== Build Information ===

Release ID: 505040015
Git revision: f93940a35458a18052f1a25e106e62ca970d9c40
Build date: 2014-11-19 13:26:21-05
Xamarin addins: dc23cbd91a3a0e1d326328e1229e86c942a49ec8

=== Operating System ===

Windows 6.2.9200.0 (64-bit)
Comment 2 Jimmy [MSFT] 2016-12-20 18:43:20 UTC
I was not able to reproduce this issue. If you still experience this crash with the latest Forms version please attach an updated repro project and reopen this report. Thanks!