Godot C# game (with nuget package Newtonsoft.Json) will crash after export
Godot version
3.4.3.stable.mono.official
System information
macOS 12.2.1, Intel, dotnet 3.1.416
Issue description
Setup a c# script that using Newtonsoft.Json to Serialize a Object. Works fine in Editor, but crash the game after export.
Steps to reproduce
Step 1
Add Package Newtonsoft.Json Reference
<Project Sdk="Godot.NET.Sdk/3.3.0">
<PropertyGroup>
<TargetFramework>net472</TargetFramework>
</PropertyGroup>
<ItemGroup>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
</ItemGroup>
</Project>
Step 2 Add c# Script to Node and calls the function
using Godot;
using Newtonsoft.Json;
using System;
public class DemoClass
{
public String FirstName;
public String LastName;
}
public class Board : Node2D
{
// Declare member variables here. Examples:
// private int a = 2;
// private string b = "text";
// Called when the node enters the scene tree for the first time.
public override void _Ready()
{
var demoData = new DemoClass
{
FirstName = "John",
LastName = "Doe"
};
var text = JsonConvert.SerializeObject(demoData);
GD.Print(text);
}
}
Step 3 Export game to macOS runnable, launch the app Error log will show
Unhandled Exception:
System.TypeInitializationException: The type initializer for 'System.ComponentModel.TypeDescriptor' threw an exception. ---> System.TypeInitializationException: The type initializer for 'Sys' threw an exception. ---> System.DllNotFoundException: /Users/zhoukaiwen/Downloads/godot_demo_macos/godot_sqlite_demo.app/Contents/MacOS/../Resources/GodotSharp/Mono/lib/../lib/libmono-native.dylib assembly:<unknown assembly> type:<unknown type> member:(null)
at (wrapper managed-to-native) Interop+Sys.LChflagsCanSetHiddenFlag()
at Interop+Sys..cctor () [0x00000] in <6a7c203f6f7a4f07b7fa766077730d49>:0
--- End of inner exception stack trace ---
at Interop.GetRandomBytes (System.Byte* buffer, System.Int32 length) [0x00000] in <6a7c203f6f7a4f07b7fa766077730d49>:0
at System.Guid.NewGuid () [0x00000] in <6a7c203f6f7a4f07b7fa766077730d49>:0
at System.ComponentModel.TypeDescriptor..cctor () [0x00034] in <214c1648d17644e0bb16ed1332c9e163>:0
--- End of inner exception stack trace ---
at Newtonsoft.Json.Serialization.JsonTypeReflector.CanTypeDescriptorConvertString (System.Type type, System.ComponentModel.TypeConverter& typeConverter) [0x00000] in <f74995119334484fb6db6825be2eac0d>:0
at Newtonsoft.Json.Serialization.DefaultContractResolver.CanConvertToString (System.Type type) [0x00000] in <f74995119334484fb6db6825be2eac0d>:0
at Newtonsoft.Json.Serialization.DefaultContractResolver.CreateContract (System.Type objectType) [0x000ab] in <f74995119334484fb6db6825be2eac0d>:0
at System.Collections.Concurrent.ConcurrentDictionary`2[TKey,TValue].GetOrAdd (TKey key, System.Func`2[T,TResult] valueFactory) [0x00034] in <6a7c203f6f7a4f07b7fa766077730d49>:0
at Newtonsoft.Json.Utilities.ThreadSafeStore`2[TKey,TValue].Get (TKey key) [0x00000] in <f74995119334484fb6db6825be2eac0d>:0
at Newtonsoft.Json.Serialization.DefaultContractResolver.ResolveContract (System.Type type) [0x0000b] in <f74995119334484fb6db6825be2eac0d>:0
at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.GetContract (System.Object value) [0x00011] in <f74995119334484fb6db6825be2eac0d>:0
at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.GetContractSafe (System.Object value) [0x00005] in <f74995119334484fb6db6825be2eac0d>:0
at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.Serialize (Newtonsoft.Json.JsonWriter jsonWriter, System.Object value, System.Type objectType) [0x00028] in <f74995119334484fb6db6825be2eac0d>:0
at Newtonsoft.Json.JsonSerializer.SerializeInternal (Newtonsoft.Json.JsonWriter jsonWriter, System.Object value, System.Type objectType) [0x0023a] in <f74995119334484fb6db6825be2eac0d>:0
at Newtonsoft.Json.JsonSerializer.Serialize (Newtonsoft.Json.JsonWriter jsonWriter, System.Object value, System.Type objectType) [0x00000] in <f74995119334484fb6db6825be2eac0d>:0
at Newtonsoft.Json.JsonConvert.SerializeObjectInternal (System.Object value, System.Type type, Newtonsoft.Json.JsonSerializer jsonSerializer) [0x00028] in <f74995119334484fb6db6825be2eac0d>:0
at Newtonsoft.Json.JsonConvert.SerializeObject (System.Object value, System.Type type, Newtonsoft.Json.JsonSerializerSettings settings) [0x00007] in <f74995119334484fb6db6825be2eac0d>:0
at Newtonsoft.Json.JsonConvert.SerializeObject (System.Object value) [0x00000] in <f74995119334484fb6db6825be2eac0d>:0
at Board._Ready () [0x0001d] in <012f315af41248adb781cad9d564780d>:0
Minimal reproduction project
Here is the demo project demo.zip
It crashed on iOS too. But works well on Android
iOS Crash Log
********** main.m
running app main
Path: /var/containers/Bundle/Application/40C02C76-AA6E-4F82-8FC2-A90D94A847BA/godot-demo.app
godot_iphone /var/containers/Bundle/Application/40C02C76-AA6E-4F82-8FC2-A90D94A847BA/godot-demo.app/godot-demo
cwd /private/var/containers/Bundle/Application/40C02C76-AA6E-4F82-8FC2-A90D94A847BA/godot-demo.app
os created
setting data dir to /var/mobile/Containers/Data/Application/F3510806-749E-4126-B967-0DE18C88BE24/Documents from /var/mobile/Containers/Data/Application/F3510806-749E-4126-B967-0DE18C88BE24/Documents
setup 0
2022-03-07 11:26:33.221738+0800 godot-demo[402:7001] Metal API Validation Enabled
2022-03-07 11:26:33.429065+0800 godot-demo[402:7001] Setting up an OpenGL ES 3.0 context. Based on Project Settings "rendering/quality/driver/driver_name"
2022-03-07 11:26:33.430303+0800 godot-demo[402:7001] failed to make complete framebuffer object 8cd6
2022-03-07 11:26:33.430419+0800 godot-demo[402:7001] Failed to create frame buffer!
******** setting up keyboard input view
******** adding observer for keyboard show/hide
start animation!
2022-03-07 11:26:33.468529+0800 godot-demo[402:7001] ERROR: AudioOutputUnitStart failed, code: -50
2022-03-07 11:26:33.468554+0800 godot-demo[402:7001] at: start (drivers/coreaudio/audio_driver_coreaudio.cpp:249) - AudioOutputUnitStart failed, code: -50
ERROR: AudioOutputUnitStart failed, code: -50
at: start (drivers/coreaudio/audio_driver_coreaudio.cpp:249) - AudioOutputUnitStart failed, code: -50
******** stop animation!
start animation!
2022-03-07 11:26:33.482662+0800 godot-demo[402:7001] ERROR: AudioOutputUnitStart failed, code: -50
2022-03-07 11:26:33.482683+0800 godot-demo[402:7001] at: start (drivers/coreaudio/audio_driver_coreaudio.cpp:249) - AudioOutputUnitStart failed, code: -50
ERROR: AudioOutputUnitStart failed, code: -50
at: start (drivers/coreaudio/audio_driver_coreaudio.cpp:249) - AudioOutputUnitStart failed, code: -50
2022-03-07 11:26:33.495728+0800 godot-demo[402:7001] Godot Engine v3.4.3.stable.mono.official.242c05d12 - https://godotengine.org
Godot Engine v3.4.3.stable.mono.official.242c05d12 - https://godotengine.org
2022-03-07 11:26:33.501859+0800 godot-demo[402:7001] OpenGL ES 3.0 Renderer: Apple A15 GPU
OpenGL ES 3.0 Renderer: Apple A15 GPU
2022-03-07 11:26:33.503817+0800 godot-demo[402:7001] OpenGL ES Batching: ON
OpenGL ES Batching: ON
2022-03-07 11:26:33.716057+0800 godot-demo[402:7001]
2022-03-07 11:26:33.874859+0800 godot-demo[402:7001] ERROR: Mono: Core API hash mismatch.
2022-03-07 11:26:33.874892+0800 godot-demo[402:7001] at: _init_godot_api_hashes (modules/mono/mono_gd/gd_mono.cpp:513) - Mono: Core API hash mismatch.
ERROR: Mono: Core API hash mismatch.
at: _init_godot_api_hashes (modules/mono/mono_gd/gd_mono.cpp:513) - Mono: Core API hash mismatch.
2022-03-07 11:26:33.875509+0800 godot-demo[402:7001] Mono: Config attempting to parse: '/private/var/containers/Bundle/Application/40C02C76-AA6E-4F82-8FC2-A90D94A847BA/godot-demo.app/data_Godot/Mono/etc/mono/config'.
2022-03-07 11:26:33.875562+0800 godot-demo[402:7001] Mono: Config attempting to parse: '/private/var/mobile/Containers/Data/Application/F3510806-749E-4126-B967-0DE18C88BE24/.mono/config'.
2022-03-07 11:26:33.891025+0800 godot-demo[402:7001] Mono: Image addref mscorlib[0x281da8000] (asmctx DEFAULT) -> .mono/assemblies/Debug/mscorlib.dll[0x11487c400]: 2
2022-03-07 11:26:33.891804+0800 godot-demo[402:7001] Mono: Prepared to set up assembly 'mscorlib' (.mono/assemblies/Debug/mscorlib.dll)
2022-03-07 11:26:33.891840+0800 godot-demo[402:7001] Mono: Found statically linked AOT module 'mscorlib'.
2022-03-07 11:26:33.973508+0800 godot-demo[402:7001] Mono: AOT: image 'mscorlib' found.
2022-03-07 11:26:33.980368+0800 godot-demo[402:7001] Mono: Assembly mscorlib[0x281da8000] added to domain GodotEngine.RootDomain, ref_count=1
2022-03-07 11:26:33.985722+0800 godot-demo[402:7001] Mono: Image addref GodotSharp[0x281dad980] (asmctx DEFAULT) -> .mono/assemblies/Debug/GodotSharp.dll[0x1150e9600]: 2
2022-03-07 11:26:33.985736+0800 godot-demo[402:7001] Mono: Prepared to set up assembly 'GodotSharp' (.mono/assemblies/Debug/GodotSharp.dll)
2022-03-07 11:26:33.985742+0800 godot-demo[402:7001] Mono: Assembly GodotSharp[0x281dad980] added to domain GodotEngine.RootDomain, ref_count=1
2022-03-07 11:26:33.985748+0800 godot-demo[402:7001] Mono: Found statically linked AOT module 'GodotSharp'.
2022-03-07 11:26:34.017221+0800 godot-demo[402:7001] Mono: Image addref System[0x281da8200] (asmctx DEFAULT) -> .mono/assemblies/Debug/System.dll[0x114877400]: 2
2022-03-07 11:26:34.017240+0800 godot-demo[402:7001] Mono: Prepared to set up assembly 'System' (.mono/assemblies/Debug/System.dll)
2022-03-07 11:26:34.017251+0800 godot-demo[402:7001] Mono: Assembly System[0x281da8200] added to domain GodotEngine.RootDomain, ref_count=1
2022-03-07 11:26:34.017257+0800 godot-demo[402:7001] Mono: Found statically linked AOT module 'System'.
2022-03-07 11:26:34.050934+0800 godot-demo[402:7001] Mono: Image addref Mono.Security[0x281dadb80] (asmctx DEFAULT) -> .mono/assemblies/Debug/Mono.Security.dll[0x115022400]: 2
2022-03-07 11:26:34.050952+0800 godot-demo[402:7001] Mono: Prepared to set up assembly 'Mono.Security' (.mono/assemblies/Debug/Mono.Security.dll)
2022-03-07 11:26:34.050958+0800 godot-demo[402:7001] Mono: Assembly Mono.Security[0x281dadb80] added to domain GodotEngine.RootDomain, ref_count=1
2022-03-07 11:26:34.050965+0800 godot-demo[402:7001] Mono: Found statically linked AOT module 'Mono.Security'.
2022-03-07 11:26:34.054076+0800 godot-demo[402:7001] Mono: AOT: image 'Mono.Security' found.
2022-03-07 11:26:34.054851+0800 godot-demo[402:7001] Mono: Image addref System.Core[0x281da8400] (asmctx DEFAULT) -> .mono/assemblies/Debug/System.Core.dll[0x114884a00]: 2
2022-03-07 11:26:34.054861+0800 godot-demo[402:7001] Mono: Prepared to set up assembly 'System.Core' (.mono/assemblies/Debug/System.Core.dll)
2022-03-07 11:26:34.054867+0800 godot-demo[402:7001] Mono: Assembly System.Core[0x281da8400] added to domain GodotEngine.RootDomain, ref_count=1
2022-03-07 11:26:34.054873+0800 godot-demo[402:7001] Mono: Found statically linked AOT module 'System.Core'.
2022-03-07 11:26:34.095827+0800 godot-demo[402:7001] Mono: AOT: image 'System.Core' found.
2022-03-07 11:26:34.096489+0800 godot-demo[402:7001] Mono: Image addref System.Numerics[0x281dadd80] (asmctx DEFAULT) -> .mono/assemblies/Debug/System.Numerics.dll[0x115023a00]: 2
2022-03-07 11:26:34.096500+0800 godot-demo[402:7001] Mono: Prepared to set up assembly 'System.Numerics' (.mono/assemblies/Debug/System.Numerics.dll)
2022-03-07 11:26:34.096505+0800 godot-demo[402:7001] Mono: Assembly System.Numerics[0x281dadd80] added to domain GodotEngine.RootDomain, ref_count=1
2022-03-07 11:26:34.096518+0800 godot-demo[402:7001] Mono: Found statically linked AOT module 'System.Numerics'.
2022-03-07 11:26:34.099981+0800 godot-demo[402:7001] Mono: AOT: image 'System.Numerics' found.
2022-03-07 11:26:34.099993+0800 godot-demo[402:7001] Mono: AOT: image 'System' found.
2022-03-07 11:26:34.100024+0800 godot-demo[402:7001] Mono: AOT: image 'GodotSharp' found.
2022-03-07 11:26:34.100360+0800 godot-demo[402:7001] Mono: Requesting loading reference 0 (of 1) of .mono/assemblies/Debug/GodotSharp.dll
2022-03-07 11:26:34.100373+0800 godot-demo[402:7001] Mono: Loading reference 0 of .mono/assemblies/Debug/GodotSharp.dll asmctx DEFAULT, looking for netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51
2022-03-07 11:26:34.100540+0800 godot-demo[402:7001] Mono: Image addref netstandard[0x281dadf80] (asmctx DEFAULT) -> .mono/assemblies/Debug/netstandard.dll[0x1150e9e00]: 2
2022-03-07 11:26:34.100548+0800 godot-demo[402:7001] Mono: Prepared to set up assembly 'netstandard' (.mono/assemblies/Debug/netstandard.dll)
2022-03-07 11:26:34.100553+0800 godot-demo[402:7001] Mono: Assembly netstandard[0x281dadf80] added to domain GodotEngine.RootDomain, ref_count=1
2022-03-07 11:26:34.100557+0800 godot-demo[402:7001] Mono: Found statically linked AOT module 'netstandard'.
2022-03-07 11:26:34.100566+0800 godot-demo[402:7001] Mono: AOT: image 'netstandard' found.
2022-03-07 11:26:34.100574+0800 godot-demo[402:7001] Mono: Assembly Ref addref GodotSharp[0x281dad980] -> netstandard[0x281dadf80]: 2
2022-03-07 11:26:34.100798+0800 godot-demo[402:7001] Mono: Requesting loading reference 0 (of 16) of .mono/assemblies/Debug/netstandard.dll
2022-03-07 11:26:34.100805+0800 godot-demo[402:7001] Mono: Loading reference 0 of .mono/assemblies/Debug/netstandard.dll asmctx DEFAULT, looking for mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e
2022-03-07 11:26:34.100811+0800 godot-demo[402:7001] Mono: Assembly Ref addref netstandard[0x281dadf80] -> mscorlib[0x281da8000]: 2
2022-03-07 11:26:34.103046+0800 godot-demo[402:7001] Mono: Requesting loading reference 2 (of 16) of .mono/assemblies/Debug/netstandard.dll
2022-03-07 11:26:34.103053+0800 godot-demo[402:7001] Mono: Loading reference 2 of .mono/assemblies/Debug/netstandard.dll asmctx DEFAULT, looking for System, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e
2022-03-07 11:26:34.103061+0800 godot-demo[402:7001] Mono: Assembly Ref addref netstandard[0x281dadf80] -> System[0x281da8200]: 2
2022-03-07 11:26:34.103242+0800 godot-demo[402:7001] Mono: Requesting loading reference 0 (of 5) of .mono/assemblies/Debug/System.dll
2022-03-07 11:26:34.103252+0800 godot-demo[402:7001] Mono: Loading reference 0 of .mono/assemblies/Debug/System.dll asmctx DEFAULT, looking for mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e
2022-03-07 11:26:34.103256+0800 godot-demo[402:7001] Mono: Assembly Ref addref System[0x281da8200] -> mscorlib[0x281da8000]: 3
2022-03-07 11:26:34.106638+0800 godot-demo[402:7001] Mono: Requesting loading reference 0 (of 2) of .mono/assemblies/Debug/System.Core.dll
2022-03-07 11:26:34.106646+0800 godot-demo[402:7001] Mono: Loading reference 0 of .mono/assemblies/Debug/System.Core.dll asmctx DEFAULT, looking for mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e
2022-03-07 11:26:34.106651+0800 godot-demo[402:7001] Mono: Assembly Ref addref System.Core[0x281da8400] -> mscorlib[0x281da8000]: 4
2022-03-07 11:26:34.106659+0800 godot-demo[402:7001] Mono: Requesting loading reference 0 (of 2) of .mono/assemblies/Debug/Mono.Security.dll
2022-03-07 11:26:34.106671+0800 godot-demo[402:7001] Mono: Loading reference 0 of .mono/assemblies/Debug/Mono.Security.dll asmctx DEFAULT, looking for mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e
2022-03-07 11:26:34.106676+0800 godot-demo[402:7001] Mono: Assembly Ref addref Mono.Security[0x281dadb80] -> mscorlib[0x281da8000]: 5
2022-03-07 11:26:34.120931+0800 godot-demo[402:7001] Mono: Image addref godot_sqlite_demo[0x281dae200] (asmctx DEFAULT) -> .mono/assemblies/Debug/godot_sqlite_demo.dll[0x11512e800]: 2
2022-03-07 11:26:34.120940+0800 godot-demo[402:7001] Mono: Prepared to set up assembly 'godot_sqlite_demo' (.mono/assemblies/Debug/godot_sqlite_demo.dll)
2022-03-07 11:26:34.120946+0800 godot-demo[402:7001] Mono: Assembly godot_sqlite_demo[0x281dae200] added to domain GodotEngine.RootDomain, ref_count=1
2022-03-07 11:26:34.120951+0800 godot-demo[402:7001] Mono: Found statically linked AOT module 'godot_sqlite_demo'.
2022-03-07 11:26:34.122416+0800 godot-demo[402:7001] Mono: Image addref Newtonsoft.Json[0x281da8680] (asmctx DEFAULT) -> .mono/assemblies/Debug/Newtonsoft.Json.dll[0x1148cc400]: 2
2022-03-07 11:26:34.122428+0800 godot-demo[402:7001] Mono: Prepared to set up assembly 'Newtonsoft.Json' (.mono/assemblies/Debug/Newtonsoft.Json.dll)
2022-03-07 11:26:34.122435+0800 godot-demo[402:7001] Mono: Assembly Newtonsoft.Json[0x281da8680] added to domain GodotEngine.RootDomain, ref_count=1
2022-03-07 11:26:34.122441+0800 godot-demo[402:7001] Mono: Found statically linked AOT module 'Newtonsoft.Json'.
2022-03-07 11:26:34.142246+0800 godot-demo[402:7001] Mono: Image addref System.Runtime.Serialization[0x281da8500] (asmctx DEFAULT) -> .mono/assemblies/Debug/System.Runtime.Serialization.dll[0x1148cd200]: 2
2022-03-07 11:26:34.142261+0800 godot-demo[402:7001] Mono: Prepared to set up assembly 'System.Runtime.Serialization' (.mono/assemblies/Debug/System.Runtime.Serialization.dll)
2022-03-07 11:26:34.142266+0800 godot-demo[402:7001] Mono: Assembly System.Runtime.Serialization[0x281da8500] added to domain GodotEngine.RootDomain, ref_count=1
2022-03-07 11:26:34.142271+0800 godot-demo[402:7001] Mono: Found statically linked AOT module 'System.Runtime.Serialization'.
2022-03-07 11:26:34.157240+0800 godot-demo[402:7001] Mono: Image addref System.Xml[0x281da8a00] (asmctx DEFAULT) -> .mono/assemblies/Debug/System.Xml.dll[0x1148cee00]: 2
2022-03-07 11:26:34.157270+0800 godot-demo[402:7001] Mono: Prepared to set up assembly 'System.Xml' (.mono/assemblies/Debug/System.Xml.dll)
2022-03-07 11:26:34.157276+0800 godot-demo[402:7001] Mono: Assembly System.Xml[0x281da8a00] added to domain GodotEngine.RootDomain, ref_count=1
2022-03-07 11:26:34.157282+0800 godot-demo[402:7001] Mono: Found statically linked AOT module 'System.Xml'.
2022-03-07 11:26:34.199066+0800 godot-demo[402:7001] Mono: AOT: image 'System.Xml' found.
2022-03-07 11:26:34.199779+0800 godot-demo[402:7001] Mono: Image addref System.ServiceModel.Internals[0x281dae380] (asmctx DEFAULT) -> .mono/assemblies/Debug/System.ServiceModel.Internals.dll[0x115137000]: 2
2022-03-07 11:26:34.199792+0800 godot-demo[402:7001] Mono: Prepared to set up assembly 'System.ServiceModel.Internals' (.mono/assemblies/Debug/System.ServiceModel.Internals.dll)
2022-03-07 11:26:34.199798+0800 godot-demo[402:7001] Mono: Assembly System.ServiceModel.Internals[0x281dae380] added to domain GodotEngine.RootDomain, ref_count=1
2022-03-07 11:26:34.199804+0800 godot-demo[402:7001] Mono: Found statically linked AOT module 'System.ServiceModel.Internals'.
2022-03-07 11:26:34.205440+0800 godot-demo[402:7001] Mono: AOT: image 'System.ServiceModel.Internals' found.
2022-03-07 11:26:34.205452+0800 godot-demo[402:7001] Mono: AOT: image 'System.Runtime.Serialization' found.
2022-03-07 11:26:34.207788+0800 godot-demo[402:7001] Mono: Image addref System.Data[0x281da8c00] (asmctx DEFAULT) -> .mono/assemblies/Debug/System.Data.dll[0x1148c0200]: 2
2022-03-07 11:26:34.207798+0800 godot-demo[402:7001] Mono: Prepared to set up assembly 'System.Data' (.mono/assemblies/Debug/System.Data.dll)
2022-03-07 11:26:34.207803+0800 godot-demo[402:7001] Mono: Assembly System.Data[0x281da8c00] added to domain GodotEngine.RootDomain, ref_count=1
2022-03-07 11:26:34.207808+0800 godot-demo[402:7001] Mono: Found statically linked AOT module 'System.Data'.
2022-03-07 11:26:34.240571+0800 godot-demo[402:7001] Mono: Image addref System.Transactions[0x281da8e00] (asmctx DEFAULT) -> .mono/assemblies/Debug/System.Transactions.dll[0x1148d1c00]: 2
2022-03-07 11:26:34.240587+0800 godot-demo[402:7001] Mono: Prepared to set up assembly 'System.Transactions' (.mono/assemblies/Debug/System.Transactions.dll)
2022-03-07 11:26:34.240593+0800 godot-demo[402:7001] Mono: Assembly System.Transactions[0x281da8e00] added to domain GodotEngine.RootDomain, ref_count=1
2022-03-07 11:26:34.240598+0800 godot-demo[402:7001] Mono: Found statically linked AOT module 'System.Transactions'.
2022-03-07 11:26:34.241178+0800 godot-demo[402:7001] Mono: AOT: image 'System.Transactions' found.
2022-03-07 11:26:34.241200+0800 godot-demo[402:7001] Mono: AOT: image 'System.Data' found.
2022-03-07 11:26:34.241862+0800 godot-demo[402:7001] Mono: Image addref System.Xml.Linq[0x281da9000] (asmctx DEFAULT) -> .mono/assemblies/Debug/System.Xml.Linq.dll[0x1148d2800]: 2
2022-03-07 11:26:34.241871+0800 godot-demo[402:7001] Mono: Prepared to set up assembly 'System.Xml.Linq' (.mono/assemblies/Debug/System.Xml.Linq.dll)
2022-03-07 11:26:34.241876+0800 godot-demo[402:7001] Mono: Assembly System.Xml.Linq[0x281da9000] added to domain GodotEngine.RootDomain, ref_count=1
2022-03-07 11:26:34.241880+0800 godot-demo[402:7001] Mono: Found statically linked AOT module 'System.Xml.Linq'.
2022-03-07 11:26:34.246687+0800 godot-demo[402:7001] Mono: AOT: image 'System.Xml.Linq' found.
2022-03-07 11:26:34.246707+0800 godot-demo[402:7001] Mono: AOT: image 'Newtonsoft.Json' found.
2022-03-07 11:26:34.246736+0800 godot-demo[402:7001] Mono: AOT: image 'godot_sqlite_demo' found.
2022-03-07 11:26:34.339239+0800 godot-demo[402:7001] Mono: Requesting loading reference 1 (of 3) of .mono/assemblies/Debug/godot_sqlite_demo.dll
2022-03-07 11:26:34.339256+0800 godot-demo[402:7001] Mono: Loading reference 1 of .mono/assemblies/Debug/godot_sqlite_demo.dll asmctx DEFAULT, looking for GodotSharp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
2022-03-07 11:26:34.339265+0800 godot-demo[402:7001] Mono: Assembly Ref addref godot_sqlite_demo[0x281dae200] -> GodotSharp[0x281dad980]: 2
2022-03-07 11:26:34.342723+0800 godot-demo[402:7001] Mono: Requesting loading reference 0 (of 3) of .mono/assemblies/Debug/godot_sqlite_demo.dll
2022-03-07 11:26:34.342737+0800 godot-demo[402:7001] Mono: Loading reference 0 of .mono/assemblies/Debug/godot_sqlite_demo.dll asmctx DEFAULT, looking for mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
2022-03-07 11:26:34.342758+0800 godot-demo[402:7001] Mono: Assembly Ref addref godot_sqlite_demo[0x281dae200] -> mscorlib[0x281da8000]: 6
2022-03-07 11:26:34.342782+0800 godot-demo[402:7001] Mono: Requesting loading reference 0 (of 8) of .mono/assemblies/Debug/Newtonsoft.Json.dll
2022-03-07 11:26:34.342791+0800 godot-demo[402:7001] Mono: Loading reference 0 of .mono/assemblies/Debug/Newtonsoft.Json.dll asmctx DEFAULT, looking for mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
2022-03-07 11:26:34.342797+0800 godot-demo[402:7001] Mono: Assembly Ref addref Newtonsoft.Json[0x281da8680] -> mscorlib[0x281da8000]: 7
2022-03-07 11:26:34.346743+0800 godot-demo[402:7001] Mono: Requesting loading reference 0 (of 2) of .mono/assemblies/Debug/System.Xml.dll
2022-03-07 11:26:34.346754+0800 godot-demo[402:7001] Mono: Loading reference 0 of .mono/assemblies/Debug/System.Xml.dll asmctx DEFAULT, looking for mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e
2022-03-07 11:26:34.346760+0800 godot-demo[402:7001] Mono: Assembly Ref addref System.Xml[0x281da8a00] -> mscorlib[0x281da8000]: 8
2022-03-07 11:26:34.348052+0800 godot-demo[402:7001] Mono: Requesting loading reference 0 (of 5) of .mono/assemblies/Debug/System.Runtime.Serialization.dll
2022-03-07 11:26:34.348062+0800 godot-demo[402:7001] Mono: Loading reference 0 of .mono/assemblies/Debug/System.Runtime.Serialization.dll asmctx DEFAULT, looking for mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e
2022-03-07 11:26:34.348068+0800 godot-demo[402:7001] Mono: Assembly Ref addref System.Runtime.Serialization[0x281da8500] -> mscorlib[0x281da8000]: 9
2022-03-07 11:26:34.348110+0800 godot-demo[402:7001] Mono: Requesting loading reference 1 (of 5) of .mono/assemblies/Debug/System.Runtime.Serialization.dll
2022-03-07 11:26:34.348117+0800 godot-demo[402:7001] Mono: Loading reference 1 of .mono/assemblies/Debug/System.Runtime.Serialization.dll asmctx DEFAULT, looking for System.Xml, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e
2022-03-07 11:26:34.348123+0800 godot-demo[402:7001] Mono: Assembly Ref addref System.Runtime.Serialization[0x281da8500] -> System.Xml[0x281da8a00]: 2
2022-03-07 11:26:34.348506+0800 godot-demo[402:7001] Mono: Requesting loading reference 0 (of 6) of .mono/assemblies/Debug/System.Data.dll
2022-03-07 11:26:34.348517+0800 godot-demo[402:7001] Mono: Loading reference 0 of .mono/assemblies/Debug/System.Data.dll asmctx DEFAULT, looking for mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e
2022-03-07 11:26:34.348522+0800 godot-demo[402:7001] Mono: Assembly Ref addref System.Data[0x281da8c00] -> mscorlib[0x281da8000]: 10
2022-03-07 11:26:34.348535+0800 godot-demo[402:7001] Mono: Requesting loading reference 1 (of 6) of .mono/assemblies/Debug/System.Data.dll
2022-03-07 11:26:34.348540+0800 godot-demo[402:7001] Mono: Loading reference 1 of .mono/assemblies/Debug/System.Data.dll asmctx DEFAULT, looking for System, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e
2022-03-07 11:26:34.348545+0800 godot-demo[402:7001] Mono: Assembly Ref addref System.Data[0x281da8c00] -> System[0x281da8200]: 3
2022-03-07 11:26:34.348646+0800 godot-demo[402:7001] Mono: Requesting loading reference 0 (of 3) of .mono/assemblies/Debug/System.ServiceModel.Internals.dll
2022-03-07 11:26:34.348654+0800 godot-demo[402:7001] Mono: Loading reference 0 of .mono/assemblies/Debug/System.ServiceModel.Internals.dll asmctx DEFAULT, looking for mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e
2022-03-07 11:26:34.348664+0800 godot-demo[402:7001] Mono: Assembly Ref addref System.ServiceModel.Internals[0x281dae380] -> mscorlib[0x281da8000]: 11
2022-03-07 11:26:34.349391+0800 godot-demo[402:7001] Mono: Requesting loading reference 0 (of 4) of .mono/assemblies/Debug/System.Xml.Linq.dll
2022-03-07 11:26:34.349398+0800 godot-demo[402:7001] Mono: Loading reference 0 of .mono/assemblies/Debug/System.Xml.Linq.dll asmctx DEFAULT, looking for mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e
2022-03-07 11:26:34.349402+0800 godot-demo[402:7001] Mono: Assembly Ref addref System.Xml.Linq[0x281da9000] -> mscorlib[0x281da8000]: 12
2022-03-07 11:26:34.353060+0800 godot-demo[402:7001] Mono: Requesting loading reference 5 (of 8) of .mono/assemblies/Debug/Newtonsoft.Json.dll
2022-03-07 11:26:34.353068+0800 godot-demo[402:7001] Mono: Loading reference 5 of .mono/assemblies/Debug/Newtonsoft.Json.dll asmctx DEFAULT, looking for System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
2022-03-07 11:26:34.353075+0800 godot-demo[402:7001] Mono: Assembly Ref addref Newtonsoft.Json[0x281da8680] -> System.Core[0x281da8400]: 2
2022-03-07 11:26:34.355144+0800 godot-demo[402:7001] Mono: Requesting loading reference 6 (of 8) of .mono/assemblies/Debug/Newtonsoft.Json.dll
2022-03-07 11:26:34.355152+0800 godot-demo[402:7001] Mono: Loading reference 6 of .mono/assemblies/Debug/Newtonsoft.Json.dll asmctx DEFAULT, looking for System.Runtime.Serialization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
2022-03-07 11:26:34.355158+0800 godot-demo[402:7001] Mono: Assembly Ref addref Newtonsoft.Json[0x281da8680] -> System.Runtime.Serialization[0x281da8500]: 2
2022-03-07 11:26:34.355626+0800 godot-demo[402:7001] Mono: Requesting loading reference 1 (of 8) of .mono/assemblies/Debug/Newtonsoft.Json.dll
2022-03-07 11:26:34.355634+0800 godot-demo[402:7001] Mono: Loading reference 1 of .mono/assemblies/Debug/Newtonsoft.Json.dll asmctx DEFAULT, looking for System.Numerics, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
2022-03-07 11:26:34.355639+0800 godot-demo[402:7001] Mono: Assembly Ref addref Newtonsoft.Json[0x281da8680] -> System.Numerics[0x281dadd80]: 2
2022-03-07 11:26:34.355645+0800 godot-demo[402:7001] Mono: Requesting loading reference 0 (of 1) of .mono/assemblies/Debug/System.Numerics.dll
2022-03-07 11:26:34.355651+0800 godot-demo[402:7001] Mono: Loading reference 0 of .mono/assemblies/Debug/System.Numerics.dll asmctx DEFAULT, looking for mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e
2022-03-07 11:26:34.355655+0800 godot-demo[402:7001] Mono: Assembly Ref addref System.Numerics[0x281dadd80] -> mscorlib[0x281da8000]: 13
2022-03-07 11:26:34.355756+0800 godot-demo[402:7001] Mono: Requesting loading reference 2 (of 8) of .mono/assemblies/Debug/Newtonsoft.Json.dll
2022-03-07 11:26:34.355767+0800 godot-demo[402:7001] Mono: Loading reference 2 of .mono/assemblies/Debug/Newtonsoft.Json.dll asmctx DEFAULT, looking for System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
2022-03-07 11:26:34.355777+0800 godot-demo[402:7001] Mono: Assembly Ref addref Newtonsoft.Json[0x281da8680] -> System[0x281da8200]: 4
2022-03-07 11:26:34.356652+0800 godot-demo[402:7001] Mono: Requesting loading reference 1 (of 5) of .mono/assemblies/Debug/System.dll
2022-03-07 11:26:34.356663+0800 godot-demo[402:7001] Mono: Loading reference 1 of .mono/assemblies/Debug/System.dll asmctx DEFAULT, looking for Mono.Security, Version=2.0.5.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756
2022-03-07 11:26:34.356670+0800 godot-demo[402:7001] Mono: Assembly Ref addref System[0x281da8200] -> Mono.Security[0x281dadb80]: 2
2022-03-07 11:26:34.359615+0800 godot-demo[402:7001] Mono: Requesting loading reference 1 (of 2) of .mono/assemblies/Debug/System.Core.dll
2022-03-07 11:26:34.359623+0800 godot-demo[402:7001] Mono: Loading reference 1 of .mono/assemblies/Debug/System.Core.dll asmctx DEFAULT, looking for System, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e
2022-03-07 11:26:34.359629+0800 godot-demo[402:7001] Mono: Assembly Ref addref System.Core[0x281da8400] -> System[0x281da8200]: 5
2022-03-07 11:26:34.361117+0800 godot-demo[402:7001] Mono: Requesting loading reference 1 (of 4) of .mono/assemblies/Debug/System.Xml.Linq.dll
2022-03-07 11:26:34.361124+0800 godot-demo[402:7001] Mono: Loading reference 1 of .mono/assemblies/Debug/System.Xml.Linq.dll asmctx DEFAULT, looking for System.Xml, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e
2022-03-07 11:26:34.361129+0800 godot-demo[402:7001] Mono: Assembly Ref addref System.Xml.Linq[0x281da9000] -> System.Xml[0x281da8a00]: 3
2022-03-07 11:26:34.367766+0800 godot-demo[402:7001] Mono: DllImport attempting to load: '/System/Library/Frameworks/Security.framework/Security'.
2022-03-07 11:26:34.367795+0800 godot-demo[402:7001] Mono: DllImport loaded library '/System/Library/Frameworks/Security.framework/Security'.
2022-03-07 11:26:34.367800+0800 godot-demo[402:7001] Mono: DllImport searching in: '/System/Library/Frameworks/Security.framework/Security' ('/System/Library/Frameworks/Security.framework/Security').
2022-03-07 11:26:34.367805+0800 godot-demo[402:7001] Mono: Searching for 'SecRandomCopyBytes'.
2022-03-07 11:26:34.367809+0800 godot-demo[402:7001] Mono: Probing 'SecRandomCopyBytes'.
2022-03-07 11:26:34.367815+0800 godot-demo[402:7001] Mono: Found as 'SecRandomCopyBytes'.
2022-03-07 11:26:34.371404+0800 godot-demo[402:7001] Mono: Requesting loading reference 7 (of 8) of .mono/assemblies/Debug/Newtonsoft.Json.dll
2022-03-07 11:26:34.371415+0800 godot-demo[402:7001] Mono: Loading reference 7 of .mono/assemblies/Debug/Newtonsoft.Json.dll asmctx DEFAULT, looking for System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
2022-03-07 11:26:34.371425+0800 godot-demo[402:7001] Mono: Assembly Ref addref Newtonsoft.Json[0x281da8680] -> System.Data[0x281da8c00]: 2
2022-03-07 11:26:34.371434+0800 godot-demo[402:7001] Mono: Requesting loading reference 2 (of 6) of .mono/assemblies/Debug/System.Data.dll
2022-03-07 11:26:34.371442+0800 godot-demo[402:7001] Mono: Loading reference 2 of .mono/assemblies/Debug/System.Data.dll asmctx DEFAULT, looking for System.Xml, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e
2022-03-07 11:26:34.371448+0800 godot-demo[402:7001] Mono: Assembly Ref addref System.Data[0x281da8c00] -> System.Xml[0x281da8a00]: 4
2022-03-07 11:26:34.381444+0800 godot-demo[402:7001]
Unhandled Exception:
System.PlatformNotSupportedException: Operation is not supported on this platform.
at System.Reflection.Emit.DynamicMethod..ctor (System.String name, System.Type returnType, System.Type[] parameterTypes, System.Type owner, System.Boolean skipVisibility) [0x00006] in <11afb9645ddb4e8fae4163490ca47a50>:0
at Newtonsoft.Json.Utilities.DynamicReflectionDelegateFactory.CreateDynamicMethod (System.String name, System.Type returnType, System.Type[] parameterTypes, System.Type owner) [0x00018] in <f74995119334484fb6db6825be2eac0d>:0
at Newtonsoft.Json.Utilities.DynamicReflectionDelegateFactory.CreateDefaultConstructor[T] (System.Type type) [0x00010] in <f74995119334484fb6db6825be2eac0d>:0
at Newtonsoft.Json.Serialization.DefaultContractResolver.GetDefaultCreator (System.Type createdType) [0x00005] in <f74995119334484fb6db6825be2eac0d>:0
at Newtonsoft.Json.Serialization.DefaultContractResolver.InitializeContract (Newtonsoft.Json.Serialization.JsonContract contract) [0x00093] in <f74995119334484fb6db6825be2eac0d>:0
at Newtonsoft.Json.Serialization.DefaultContractResolver.CreateObjectContract (System.Type objectType) [0x00007] in <f74995119334484fb6db6825be2eac0d>:0
at Newtonsoft.Json.Serialization.DefaultContractResolver.CreateContract (System.Type objectType) [0x0010f] in <f74995119334484fb6db6825be2eac0d>:0
at System.Collections.Concurrent.ConcurrentDictionary`2[TKey,TValue].GetOrAdd (TKey key, System.Func`2[T,TResult] valueFactory) [0x00034] in <11afb9645ddb4e8fae4163490ca47a50>:0
at Newtonsoft.Json.Utilities.ThreadSafeStore`2[TKey,TValue].Get (TKey key) [0x00000] in <f74995119334484fb6db6825be2eac0d>:0
at Newtonsoft.Json.Serialization.DefaultContractResolver.ResolveContract (System.Type type) [0x0000b] in <f74995119334484fb6db6825be2eac0d>:0
at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.GetContract (System.Object value) [0x00011] in <f74995119334484fb6db6825be2eac0d>:0
at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.GetContractSafe (System.Object value) [0x00005] in <f74995119334484fb6db6825be2eac0d>:0
at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.Serialize (Newtonsoft.Json.JsonWriter jsonWriter, System.Object value, System.Type objectType) [0x00028] in <f74995119334484fb6db6825be2eac0d>:0
at Newtonsoft.Json.JsonSerializer.SerializeInternal (Newtonsoft.Json.JsonWriter jsonWriter, System.Object value, System.Type objectType) [0x0023a] in <f74995119334484fb6db6825be2eac0d>:0
at Newtonsoft.Json.JsonSerializer.Serialize (Newtonsoft.Json.JsonWriter jsonWriter, System.Object value, System.Type objectType) [0x00000] in <f74995119334484fb6db6825be2eac0d>:0
at Newtonsoft.Json.JsonConvert.SerializeObjectInternal (System.Object value, System.Type type, Newtonsoft.Json.JsonSerializer jsonSerializer) [0x00028] in <f74995119334484fb6db6825be2eac0d>:0
at Newtonsoft.Json.JsonConvert.SerializeObject (System.Object value, System.Type type, Newtonsoft.Json.JsonSerializerSettings settings) [0x00007] in <f74995119334484fb6db6825be2eac0d>:0
at Newtonsoft.Json.JsonConvert.SerializeObject (System.Object value) [0x00000] in <f74995119334484fb6db6825be2eac0d>:0
at Board._Ready () [0x0001d] in <a4ac9bbffb694baf9a17827626c934ff>:0
2022-03-07 11:26:34.382233+0800 godot-demo[402:7001]
Unhandled Exception:
System.PlatformNotSupportedException: Operation is not supported on this platform.
at System.Reflection.Emit.DynamicMethod..ctor (System.String name, System.Type returnType, System.Type[] parameterTypes, System.Type owner, System.Boolean skipVisibility) [0x00006] in <11afb9645ddb4e8fae4163490ca47a50>:0
at Newtonsoft.Json.Utilities.DynamicReflectionDelegateFactory.CreateDynamicMethod (System.String name, System.Type returnType, System.Type[] parameterTypes, System.Type owner) [0x00018] in <f74995119334484fb6db6825be2eac0d>:0
at Newtonsoft.Json.Utilities.DynamicReflectionDelegateFactory.CreateDefaultConstructor[T] (System.Type type) [0x00010] in <f74995119334484fb6db6825be2eac0d>:0
at Newtonsoft.Json.Serialization.DefaultContractResolver.GetDefaultCreator (System.Type createdType) [0x00005] in <f74995119334484fb6db6825be2eac0d>:0
at Newtonsoft.Json.Serialization.DefaultContractResolver.InitializeContract (Newtonsoft.Json.Serialization.JsonContract contract) [0x00093] in <f74995119334484fb6db6825be2eac0d>:0
at Newtonsoft.Json.Serialization.DefaultContractResolver.CreateObjectContract (System.Type objectType) [0x00007] in <f74995119334484fb6db6825be2eac0d>:0
at Newtonsoft.Json.Serialization.DefaultContractResolver.CreateContract (System.Type objectType) [0x0010f] in <f74995119334484fb6db6825be2eac0d>:0
at System.Collections.Concurrent.ConcurrentDictionary`2[TKey,TValue].GetOrAdd (TKey key, System.Func`2[T,TResult] valueFactory) [0x00034] in <11afb9645ddb4e8fae4163490ca47a50>:0
at Newtonsoft.Json.Utilities.ThreadSafeStore`2[TKey,TValue].Get (TKey key) [0x00000] in <f74995119334484fb6db6825be2eac0d>:0
at Newtonsoft.Json.Serialization.DefaultContractResolver.ResolveContract (System.Type type) [0x0000b] in <f74995119334484fb6db6825be2eac0d>:0
at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.GetContract (System.Object value) [0x00011] in <f74995119334484fb6db6825be2eac0d>:0
at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.GetContractSafe (System.Object value) [0x00005] in <f74995119334484fb6db6825be2eac0d>:0
at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.Serialize (Newtonsoft.Json.JsonWriter jsonWriter, System.Object value, System.Type objectType) [0x00028] in <f74995119334484fb6db6825be2eac0d>:0
at Newtonsoft.Json.JsonSerializer.SerializeInternal (Newtonsoft.Json.JsonWriter jsonWriter, System.Object value, System.Type objectType) [0x0023a] in <f74995119334484fb6db6825be2eac0d>:0
at Newtonsoft.Json.JsonSerializer.Serialize (Newtonsoft.Json.JsonWriter jsonWriter, System.Object value, System.Type objectType) [0x00000] in <f74995119334484fb6db6825be2eac0d>:0
at Newtonsoft.Json.JsonConvert.SerializeObjectInternal (System.Object value, System.Type type, Newtonsoft.Json.JsonSerializer jsonSerializer) [0x00028] in <f74995119334484fb6db6825be2eac0d>:0
at Newtonsoft.Json.JsonConvert.SerializeObject (System.Object value, System.Type type, Newtonsoft.Json.JsonSerializerSettings settings) [0x00007] in <f74995119334484fb6db6825be2eac0d>:0
at Newtonsoft.Json.JsonConvert.SerializeObject (System.Object value) [0x00000] in <f74995119334484fb6db6825be2eac0d>:0
at Board._Ready () [0x0001d] in <a4ac9bbffb694baf9a17827626c934ff>:0
libc++abi: terminating with uncaught exception of type std::__1::system_error: recursive_mutex lock failed: Invalid argument
dyld4 config: DYLD_LIBRARY_PATH=/usr/lib/system/introspection DYLD_INSERT_LIBRARIES=/Developer/usr/lib/libBacktraceRecording.dylib:/Developer/usr/lib/libMainThreadChecker.dylib:/Developer/Library/PrivateFrameworks/DTDDISupport.framework/libViewDebuggerSupport.dylib:/Developer/Library/PrivateFrameworks/GPUTools.framework/libglInterpose.dylib
terminating with uncaught exception of type std::__1::system_error: recursive_mutex lock failed: Invalid argument
(lldb)
CC @godotengine/mono
Weirdly enough, this didn't happen to me with Newtonsoft.Json. But it now happens when I try to add the Magick.NET-Q8-AnyCPU package to my build. Upon reaching the library in my code, the game crashes with in the same fashion, both in the editor and after exporting the project as a windows binary. The former library still works fine though.
I also tried changing the TargetFramework property to netstandard2.1, which seems to not affect this issue.
This happens to me anytime I add the ink-runtime dll as reference.
<ItemGroup>
<Reference Include="Ink">
<HintPath>$(ProjectDir)/ink-engine-runtime.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
This only happens to me on Android, not desktop (Linux). This is using Godot 3.5.1
P.S. This fails the same way if I swap my dll reference for the nuget PackageReference O.P. listed
There is the same issue on Unity3d. https://forum.unity.com/threads/notsupportedexception-with-log-detail.543644/ Here is a simple solution I found. I confirmed this worked at least on iOS.
- Use
<PackageReference Include="Json.NET.Aot" Version="9.0.1" />instead of<PackageReference Include="Newtonsoft.Json" Version="13.0.1" /> - Add
using Newtonsoft.Json.Utilities;in your .cs code - Add
AotHelper.EnsureType<DemoClass>();before callJsonConvert.SerializeObject(demoData);
I'm not sure it works on macOS as well. Please let me know how it goes if someone tries this on macOS. Thanks!
I encountered an AOT-related error while using C# code in Godot 4.3-stable, specifically when calling APIs containing Enums in code generated by the OpenAPI Generator.
While Unity offers an official package with AOT-related fixes via Unity Package Manager, I couldn't find an equivalent solution for Godot. The older forks of Newtonsoft.JSON supporting AOT uses outdated version, and even for some reason, I couldn't import the AotHelper class when applying these libraries to my project.
Solution
- I took the code from https://github.com/applejag/Newtonsoft.Json-for-Unity/blob/master/Src/Newtonsoft.Json/Utilities/AotHelper.cs and included only the necessary parts in my project.
- The
EnsureListandEnsureDictionaryfunctions didn't compile and weren't necessary for my use case, so I removed them. - I continued using the Newtonsoft.Json library with
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />.
Error Message (from exported Xcode project console)
ERROR: Newtonsoft.Json.JsonException: Error creating 'Newtonsoft.Json.Converters.StringEnumConverter'.
---> Newtonsoft.Json.JsonException: No parameterless constructor defined for 'Newtonsoft.Json.Converters.StringEnumConverter'.
at Newtonsoft.Json.Serialization.JsonTypeReflector.<>c__DisplayClass22_0.<GetCreator>b__0(Object[] parameters) + 0x25c
...
Added Code
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Utilities;
public partial class GameManager : Node2D
{
public override void _Ready()
{
AotHelper.EnsureType<StringEnumConverter>();
}
}
Notes
GameManageris just an example; the important part is to add this to any appropriate script that loads when the project first starts.- I'm uncertain whether this code needs to be placed in an Autoload script. If anyone has experience with this, please share your insights. It might work regardless of where it's placed, as long as the code compiles.
- As your case might differ, try wrapping the class mentioned in the error message with
AotHelper.EnsureTypeto see if that resolves the issue.
Modified Full AotHelper.cs Code
#region License
// The MIT License (MIT)
//
// Copyright (c) 2016 SaladLab
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
#endregion
using System;
namespace Newtonsoft.Json.Utilities
{
/// <summary>
///
/// </summary>
public static class AotHelper
{
/// <summary>
/// Don't run action but let a compiler detect the code in action as an executable block.
/// </summary>
public static void Ensure(Action action)
{
if (IsFalse())
{
try
{
action();
}
catch (Exception e)
{
throw new InvalidOperationException("", e);
}
}
}
/// <summary>
/// Ensure(() => new T());
/// </summary>
public static void EnsureType<T>() where T : new()
{
Ensure(() => new T());
}
private static bool s_alwaysFalse = DateTime.UtcNow.Year < 0;
/// <summary>
/// Always return false but compiler doesn't know it.
/// </summary>
/// <returns>False</returns>
public static bool IsFalse()
{
return s_alwaysFalse;
}
}
}
I hope this code snippet is helpful to others.