"Segmentation fault" when pushing page

So after finally getting emulator to work I started my first project in Visual Studio 2019 (XAML).

A very simple app that pushes a page when a button in MainPage is clicked. Essentially:

        private async void Button_OnClicked(object sender, EventArgs e)
            {
                await Navigation.PushAsync(new DiscoverPage());
            }

Discover page being freshly created ContentPage with some basic content.

I’m getting the exception “Segmentation fault”. Stack trace & screenshot:

     	???	
 	???	
 	???	
 	???	
 	[Unknown/Just-In-Time compiled code]	
 	???	
 	g_main_context_dispatch	
 	???	
 	???	
 	???	
 	ecore_main_loop_begin	
 	elm_run	
 	???	
 	appcore_base_init	
 	appcore_ui_base_init	
 	appcore_efl_base_init	
 	???	
 	ui_app_main	
 	[Unknown/Just-In-Time compiled code]	
>	Quest_Program::Main() Line 20	C#
 	???	
 	???	
 	???	
 	???	
 	???	
 	coreclr_execute_assembly	
 	tizen::runtime::dotnetcore::CoreRuntime::launch(char const*, char const*, char const*, int, char**)	
 	main	
 	???	
 	_start	

I’m using Windows 10, Tizen.NET 6.0.0.14995, Tizen 4.0

Can anyone help?

The Segmentation Failed error you’re facing could be caused by a lack of proper Initialization. Like missing to instantiate any object, pages, classes, etc.

You might have a revision on the codes for such occurrences.

For Example, Such error can be caused when there’s no object of NavigationPage.

MainPage = new TizenWearableXamlApp.MainPage();

By creating an object of NavigationPage we can resolve the issue like:

MainPage = new NavigationPage(new TizenWearableXamlApp.MainPage());

You can find more details about the implementation of Navigation in the Xamarin guide.

It’s just an example, this can also be due to any similar initialization issues or any by other bugs. Hope this helps, otherwise you might upload the Sample Project/Solution here for support from Samsung Developer Community.

Thank you. Creating NavigationPage solved the issue!