Xamarin: InitializeComponent () is too complex - xamarin

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

Related

Configure platform page with platform specific options

We've begun evaluating Xamarin for a up and coming project involving both iOS and Android, with the overriding intention to produce a single UI layer (and some share code, obviously) (I'm also new to C#)
TL;DR
I've begun exploring Xamarin on iOS. I started with the Phoneword example and it worked well enough.
The first issue I found was running the code on the iPhone X, which I was able to solve by using MainPage.On<Xamarin.Forms.PlatformConfiguration.iOS>().SetUseSafeArea(true); in the platform App class
While testing this, I noticed some issues with the ListView not scrolling properly (the core issue was actually with the platform padding).
I then used (MainPage as Xamarin.Forms.NavigationPage).On<iOS>().EnableTranslucentNavigationBar(); to enable translucent navigation bars (as we're targeting iOS 11+) and now everything appears under the navigation bar.
This is easily fixed in xCode and after some research I've found that I need to be using UIKit.UIViewController.EdgesForExtendedLayout Property, the immediate problem I'm facing is, the only "snippets" of code I can find are from the View is displayed under status bar in iOS 7 and EdgesForExtendedLayout doesn't help forum post.
Issue at hand...
The example solution snippets posted seem to be making use of a platform (iOS) specific solution. The problem is, I want to keep using the "cross-platform" code in the "platform" project and simply provide some custom configuration for the iOS platform which can apply these states.
I understand it could be possible to use a renderer, but this seems to counter-interactive, as I'd need one for both iOS and Android, where the platform page is doing just fine as it.
I understand that I could setup a DependencyService, but this seems annoying to have to include a specific "configuration" service just to solve this issue for iOS
I was hoping it might be possible to setup a iOS Page which would "override" some of the functionality of the platform page and would allow me to make use of things like viewDidLoad so I can apply the iOS specific configurations on a page by pages bases, so we could keep the platform page as it, but when running under iOS, it would provide me access to iOS life cycle of the actual view...
I've been trying to search the documentation and tutorials and haven't yet come across anything which would seem to do this or something similar (not to say there isn't one, but I'm just not finding it).

How to debug when using Google VR (Daydream) and Unity?

I'm using the latest Google VR SDK and Unity 5.6. I've got a Daydream headset/controller and I'm trying to develop a game. I've been stuck on a problem for a while now, which in a typical Unity environment I should be able to solve very quickly, but because I'm forced to build/run the code to the device each time I want to test I'm unable to view the console nor see any error/warnings which are thrown.
Any idea on how I can debug using Unity, or even emulate the Daydream controller/headset within Unity? I've seen that a controller emulator exists, but it appears you still have to run on the device, only in that scenario you have to have two phones; one acting as the controller and another as the 'screen'.
Thanks
Check out this asset Log Viewer.
Using this asset you can see the same log console in Unity Editor in runtime. I don't know about DayDream but it worked for me on Android, Oculus, and GearVR.

Windows Phone 8.1: App crashes in fast app switcher when not attached to debugger

I have been developing this app for quite a long time, and have had little or no issues. But when I decided to test it without the debugger attached, it caused problems with the fast app switcher. Whenever I switch the app with fast app switcher (or by pressing Start button), it causes the app to crash.
I am using VS2015 and tried enabling break for all exceptions, but still nothing happens while debugging, so I can't understand what the actual problem is.
Any ideas how can I solve this??
P.S. There seem to be a solution for this in this thread: Fast App Resume crashing on WP8.1 when not attached to debugger, but it is intended for Windows Phone 8 and doesn't match with the 8.1 api. Any similar solutions for WP8.1??
have you tried to implement the NavigationHelpers in your app ?
http://mtaulty.com/CommunityServer/blogs/mike_taultys_blog/archive/2014/05/23/windows-phone-8-1-frame-page-navigationhelper-suspensionmanager.aspx
I think that may help you :)

App approved, but crashes

I have made a Windows Phone app (for WP7.1) that uses BackgroundAudio for streaming, nothing too complicated. It was approved and made available for download in the store. However it no longer works, i.e. the app worked in debug+release when run from VS2012, and I assume the .xap I uploaded worked since microsoft approved it (they rejected it once and I was able to reproduce and fix the bugs they reported).
When downloaded the app simply bails on load on WP8 (lumia 820) i.e. flips back to the tiles immediately.
On WP7 (lumia 800) but the playbutton ignores input, however it downloads and displays the playlist, so some kind of functionality+network connection works.
I have tried the basics: installing using the application-deployment tool (app working), running the "Store Test Kit" which reports some slowdowns in the UI animations, but nothing serious (I hope).
Any ideas how to reproduce ".xap approved and downloaded from store but not working" or getting debug info from the phone without VS? Or any other things i can try out?
Every time your app crashes it will be logged and reported on your Windows Phone Dev Center Account. Just go in there and export the details to excel. Get the stack trace and put it in here. Maybe we can help.
The very first thing i can tell you is the opening page has some exceptions and that too it doesn't go well with some phones. Seriously there are concerns when a wp7 app is ported on wp8 device and vice-verse. To the extent of my knowledge there might be some binding issues. make sure you got the binding class to be public. And just as #AMR mentioned go the dev center and export the stacktrace. Try resolving them. Moreover if an app get certifies, it doesn't mean it is completely error free. The tests are limited to very coomon errors only.

The parameter is incorrect exception

I'm working on a Windows Phone 7.1 project and got most of my work done and decided to add to the project the images for my tiles (62x62 and 173x173 PNGs) plus the JPG file for the splash screen (SplashScreenImage.jpg 480x800).
Before adding these images to the project my project was running fine! After adding them and setting the tiles images to the 2 new files, my project still builds ok, but when running on the 7.1 simulator (my acer laptop doesn't have hardware assisted virtualization enabled in order to run the wp8 emulator) the app crashes when trying to load MainPage with "The parameter is incorrect" exception (in the Application_UnhandledException handler).
I've been trying to find a solution on the web for the last 1-2 days, found few mentions of this error and few possible causes, but none of my findings helped so far. The exception doesn't say anything helpful and it's getting really frustrating considering that most of the serious work is done and I'm very close to releasing the app to the marketplace.
Did anybody run into this issue before? Any ideas what could have gone wrong and how I could solve this exception? Any help is much appreciated!
Thank you in advance!
Andrei
Whenever I wish to change the Splashscreen and other images, here is what I do:
Locate the file on disk using Windows Explorer.
Open the file using some image editor (I use Paint.NET)
Remove the default image and replace with your image maintaining the dimensions.
Save the image and return to Visual Studio.
Rebuild the entire project.
This works seamlessly without any errors. ;)

Resources