1

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

user2669261
  • 396
  • 1
  • 5
  • 18
  • Ideally, there should not be any issue with this never even heard about something like this before, Are you sure your XAML is properly framed and that the chunk of code you removed did not have anything that was actually the reason for this all along? – FreakyAli Jun 07 '19 at 10:04
  • Me neither! Yes, I actually removed the part and replaced it with something else but no luck. It seems that the error occurs once I pass a certain amount of lines (about 5400) – user2669261 Jun 07 '19 at 10:09
  • Off topic, but I think such a large AbsoluteLayout may run into performance issues. Are you sure you can't simplify it? – Dennis Schröer Jun 07 '19 at 10:13
  • Are you compiling the Xaml at build time with `[XamlCompilation(XamlCompilationOptions.Compile)]`, or allowing it to compile at runtime? – Max Hampton Jun 07 '19 at 16:31
  • @MaxHampton tried both. Same error for both methods – user2669261 Jun 07 '19 at 16:44
  • It seems, something issue with your xaml code check by adding and removing chunks of the xaml code, definitely it will be solvable. – KiShOrE Jun 12 '19 at 07:04
  • Were you able to figure this out? – Saamer Jun 12 '19 at 19:53
  • nope. I reorganized my layout – user2669261 Jun 12 '19 at 22:39
  • @user2669261 If you haven't solved it yet you can open a support ticket here: https://support.microsoft.com/en-us/supportforbusiness/productselection?sapId=211dd84f-3474-c3c5-79bf-66db630c92a6. Post your sample there to help us investigate what causes this issue. – Ax1le Jun 27 '19 at 01:21

0 Answers0