Bug 27617 - Tabbed Page Exception Thrown in iPad but not iPhone
Summary: Tabbed Page Exception Thrown in iPad but not iPhone
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 1.3.5
Hardware: Other Other
: --- normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2015-03-03 17:04 UTC by Andrew Page
Modified: 2015-03-04 09:28 UTC (History)
3 users (show)

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:

Description Andrew Page 2015-03-03 17:04:12 UTC
Have a project whose front end is a TabbedPage.  When running on an iPhone Simulator, iTouch it's fine, but when running on an iPad simulator or hardware iPad, the following exception is thrown.  It doesn't throw when running on an Adroid tablets either.

System.InvalidOperationException: Sequence contains no elements
  at System.Linq.Enumerable.Last[UIViewController] (IEnumerable`1 source) [0x0001e] in ///Library/Frameworks/Xamarin.iOS.framework/Versions/
  at Xamarin.Forms.Platform.iOS.NavigationRenderer.<.ctor>b__0 (Xamarin.Forms.Platform.iOS.TabletMasterDetailRenderer sender) [0x00000] in <filename unknown>:0
  at Xamarin.Forms.MessagingCenter+<>c__DisplayClass4`1[Xamarin.Forms.Platform.iOS.TabletMasterDetailRenderer].<Subscribe>b__3 (System.Object sender, System.Object args) [0x00000] in <filename unknown>:0
  at Xamarin.Forms.MessagingCenter.InnerSend (System.String message, System.Type senderType, System.Type argType, System.Object sender, System.Object args) [0x00000] in <filename unknown>:0
  at Xamarin.Forms.MessagingCenter.Send[TabletMasterDetailRenderer] (Xamarin.Forms.Platform.iOS.TabletMasterDetailRenderer sender, System.String message) [0x00000] in <filename unknown>:0
  at Xamarin.Forms.Platform.iOS.TabletMasterDetailRenderer.HandlePropertyChanged (System.Object sender, System.ComponentModel.PropertyChangedEventArgs e) [0x00000] in <filename unknown>:0
  at at (wrapper delegate-invoke) <Module>:invoke_void_object_PropertyChangedEventArgs (object,System.ComponentModel.PropertyChangedEventArgs)
  at Xamarin.Forms.BindableObject.OnPropertyChanged (System.String propertyName) [0x00000] in <filename unknown>:0
  at Xamarin.Forms.BindableObject.SetValueActual (Xamarin.Forms.BindableProperty property, Xamarin.Forms.BindablePropertyContext context, System.Object value, Boolean currentlyApplying, SetValueFlags attributes, Boolean silent) [0x00000] in <filename unknown>:0
  at Xamarin.Forms.BindableObject.SetValueCore (Xamarin.Forms.BindableProperty property, System.Object value, SetValueFlags attributes, SetValuePrivateFlags privateAttributes) [0x00000] in <filename unknown>:0
  at Xamarin.Forms.BindableObject.SetValue (Xamarin.Forms.BindableProperty property, System.Object value, Boolean fromStyle, 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.Platform.iOS.Platform.SetRenderer (Xamarin.Forms.BindableObject bindable, IVisualElementRenderer value) [0x00000] in <filename unknown>:0
  at Xamarin.Forms.Platform.iOS.TabbedRenderer.SetupPage (Xamarin.Forms.Page page, Int32 index) [0x00000] in <filename unknown>:0
  at Xamarin.Forms.Platform.iOS.TabbedRenderer.Reset () [0x00000] in <filename unknown>:0
  at Xamarin.Forms.NotifyCollectionChangedEventArgsExtensions.Apply (System.Collections.Specialized.NotifyCollectionChangedEventArgs self, System.Action`3 insert, System.Action`2 removeAt, System.Action reset) [0x00000] in <filename unknown>:0
  at Xamarin.Forms.Platform.iOS.TabbedRenderer.OnPagesChanged (System.Object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) [0x00000] in <filename unknown>:0
  at Xamarin.Forms.Platform.iOS.TabbedRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x00000] in <filename unknown>:0
  at Xamarin.Forms.Platform.iOS.RendererFactory.GetRenderer (Xamarin.Forms.VisualElement view) [0x00000] in <filename unknown>:0
  at Xamarin.Forms.Platform.iOS.NavigationRenderer.CreateViewControllerForPage (Xamarin.Forms.Page page) [0x00000] in <filename unknown>:0
  at Xamarin.Forms.Platform.iOS.NavigationRenderer+<OnPushAsync>d__19.MoveNext () [0x00000] in <filename unknown>:0
  at --- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000b] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System.Runtime.ExceptionServices/ExceptionDispatchInfo.cs:62
  at System.Runtime.CompilerServices.TaskAwaiter`1[System.Boolean].GetResult () [0x00034] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System.Runtime.CompilerServices/TaskAwaiter_T.cs:59
  at Xamarin.Forms.Platform.iOS.NavigationRenderer+<<ViewDidLoad>b__3>d__4.MoveNext () [0x00000] in <filename unknown>:0
Comment 1 Andrew Page 2015-03-04 09:28:25 UTC
The 'template' project has changed.   I have a high degree of confidence that rebuilding it to the new template(or should I wait for the next one?) will resolve the exception.   

However, in attempting to duplicate the issue I created a new Forms project with a similar structure on the current(?) template for a X-platform mobile app and while an exception wasn't thrown a tabbed page wasn't rendering properly for the iPad.   A different bug will be pending for that as soon as I tear down my old project and rebuild it.