NET app cannot be started on Galaxy Watch 3, crashes on Internal CLR error (0x80131506)

Hi, our Xamarin.Forms app for Samsung Watch (Tizen) did not pass the review process to Samsung Store, because it crashed on startup. The log says:

System.NullReferenceException: Object reference not set to an instance of an object.
   at KTizen.App..ctor()
   at KTizen.Program.OnCreate()
   at Tizen.Applications.CoreBackend.UICoreBackend.OnCreateNative(IntPtr data)
   at Tizen.Applications.CoreBackend.UICoreBackend.Run(String[] args)
   at Tizen.Applications.CoreApplication.Run(String[] args)
   at Tizen.Applications.CoreUIApplication.Run(String[] args)
   at KomootTizen.Program.Main(String[] args)
Fatal error. 
Internal CLR error. (0x80131506)
   at Interop+Application.Main(Int32, System.String[], UIAppLifecycleCallbacks ByRef, IntPtr)
   at Tizen.Applications.CoreBackend.UICoreBackend.Run(System.String[])
   at Tizen.Applications.CoreApplication.Run(System.String[])
   at Tizen.Applications.CoreUIApplication.Run(System.String[])
   at KomootTizen.Program.Main(System.String[])
onSigabrt called

This seems to be an internal exception in the .NET Core itself / device firmware issue. How can we debug this? How can we fix it?

We have all our code in the contructor wrapped with a try/catch block, so technically it should never crash there.

Edited by: Tomas Slavicek on 16 Sep, 2020


4 Replies
Tizen .NET

Does the issue occur on only Galaxy Watch 3 (Tizen 5.5)? Or does it also occur on Galaxy Watch (Tizen 4.0)?
It is difficult to check the issue with only the exception log you shared with us.
We would appreciate it if you send us( the sample code and test environment(such as Galaxy Watch 3 SW verion info) that can reproduce this problem.
Thank you in advance.

Tomas Slavicek

I was finally able to reproduce this problem. Yes, this happens only on a Galaxy Watch 3 with Tizen 5.5, it works correctly on Galaxy Active with Tizen 4.0

More logs from the device:

System.NotSupportedException: Unsupported feature at Tizen.Network.Connection.ConnectionErrorFactory.ThrowConnectionException(Int32 errno, String message) at Tizen.Network.Connection.ConnectionInternalManager.get_EthernetState() at Tizen.Network.Connection.ConnectionItem.get_State() at KomootTizen.Runtime..ctor(IStorageService storage) at KomootTizen.App..ctor()

You cannot call ConnectionManager.CurrentConnection.State from App constructor, or from a property definition, this crashes the whole device. If you call the ConnectionManager.CurrentConnection.Type, it works correctly.

For example this code in the App constructor means that the app will not start:

_lastConnectionState = ConnectionManager.CurrentConnection.State;

But it gets weird :) If you write this in the code, and push the .tpk file into the device, it works. If you upload this .tpk file into Samsung beta store, then the app cannot be started on the watch. Not sure how this can be different, but you really need to upload the app into beta store or to the public store to see it.

I compile with the Visual Studio 2019, and the Tizen.NET.Sdk 1.0.9 (the same problem happens with the Sdk 1.1.5). I specify explicitly that I want only the tizen-armel architecture, otherwise the .csproj file is pretty standard:

<Project Sdk="Tizen.NET.Sdk/1.0.9">
    <ApplicationIcon />
    <PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
    <PackageReference Include="SkiaSharp.Views.Forms" Version="1.68.3" />
    <PackageReference Include="Tizen.Wearable.CircularUI" Version="1.4.0" />
    <PackageReference Include="Xamarin.Essentials" Version="" />
    <PackageReference Include="Xamarin.Forms" Version="" />

It was good that I could get the logs from the device via Device Manager, but still took me really long time to discover this. Thank you, if you can look on it and fix it :)

Tizen .NET


Thank you for reporting the problem. It will be fixed soon. (We have the public MR schedule at the end of October for Galaxy Watch 3 BT model)

Sorry for the inconvenience.



Tomas Slavicek

What's odd, that I had all of my code wrapped with try/catch, but it still did not catch the error and the app crashed on onSigabrt called. There must be something wrong in the libraries.