Forum Cross Platform with Xamarin

InitializeComponent () is too complex


I am currently developing an App for IOS and Android with Xamarin Forms. I am debugging with my Android device.

Starting yesterday, when trying to build and test my solution, it falls into a break state before the App is even loaded.

The exception is:

System.InvalidProgramException: Method wuut.Discover:InitializeComponent () is too complex.

It works when I unplug my Android device and open the App on developer mode. But I really need the Console etc. so right now, I am unable to continue developing my app.

I looked up the exception on Google but couldn't really find anything similar to my problem.

The error occurs inside InitializeComponent on one of my Contentpages containing an AbsoluteLayout.

The AbsoluteLayout is rather big with 5400 Lines of Code. So looking into the error messages, I tried to remove a few chunks of my XAML and it started working again.

So my question is: Does XAML or Xamarin have some limitations on how big an AbsoluteLayout/Contentpage should be? If not, how would I resolve this issue?

Thanks in advance and kind regards


  • JiriMatejkaJiriMatejka CZMember ✭✭✭

    Am not sure if there is any string limitation but layout file of 5400 lines is extreme indeed. I would strongly suggest to make it simpler, possible split into multiple pages or so.

Sign In or Register to comment.