Hello,
I have an app on the app store which was compiled with Mono. It uses the open source TZ4NET .dll for time zone operations. I am able to compile the app and run it however the following line which references the TZ4NET library fails. I’ve tried both the dll and using the code itself and it fails. TZ4NET - http://www.babiej.demon.nl/Tz4Net/main.htm
OlsonTimeZonefromZone = OlsonTimeZone.GetInstanceFromOlsonName(“Etc/UTC”);
Bellow is the error which I am getting. Any help is appreciated as I am stuck on this for a few weeks now. It doesn’t seem that it is a TZ4NET issue since it works fine with Mono.
UnityEngine.Debug:Internal_Log(Int32, String, Object)
UnityEngine.Debug:Log(Object)
MainScript:GetUTCDateTime(String, String, String, String, String, String)
MainScript:PopulateInputGates(String)
MainScript:PrepareInputGates()
MainScript:CalculateHD()
LoadChart:OnPress(Boolean)
UnityEngine.GameObject:SendMessage(String, Object, SendMessageOptions)
UICamera:Notify(GameObject, String, Object)
UICamera:ProcessRelease(Boolean, Single)
UICamera:ProcessTouch(Boolean, Boolean)
UICamera:ProcessTouches()
UICamera:Update()
(Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)
MissingMethodException: No constructor found for System.Resources.RuntimeResourceSet::.ctor(System.IO.UnmanagedMemoryStream)
at System.ArgumentOutOfRangeException…ctor (System.String paramName, System.String message) [0x00000] in :0
at System.Activator.CreateInstance (System.Type type, BindingFlags bindingAttr, System.Reflection.Binder binder, System.Object[ ] args, System.Globalization.CultureInfo culture, System.Object[ ] activationAttributes) [0x00000] in :0
at System.Activator.CreateInstance (System.Type type, System.Object[ ] args, System.Object[ ] activationAttributes) [0x00000] in :0
at System.Activator.CreateInstance (System.Type type, System.Object[ ] args) [0x00000] in :0
at System.Resources.ResourceManager.InternalGetResourceSet (System.Globalization.CultureInfo culture, Boolean createIfNotExists, Boolean tryParents) [0x00000] in :0
at System.Resources.ResourceManager.GetObject (System.String name, System.Globalization.CultureInfo culture) [0x00000] in :0
at System.Resources.ResourceManager.GetObject (System.String name) [0x00000] in :0
at TZ4Net.ZoneInfo.get_AllDirs () [0x00000] in :0
at TZ4Net.ZoneInfo…ctor (System.String name, System.String dir) [0x00000] in :0
at TZ4Net.ZoneInfo…ctor (System.String name) [0x00000] in :0
at TZ4Net.ZoneInfo+Time…cctor () [0x00000] in :0
at TZ4Net.OlsonTimeZone…cctor () [0x00000] in :0
at MainScript.GetUTCDateTime (System.String pCountry, System.String pCity, System.String pYear, System.String pMonth, System.String pDay, System.String pTime) [0x00000] in :0
at MainScript.PopulateInputGates (System.String ChartType) [0x00000] in :0
at MainScript.PrepareInputGates () [0x00000] in :0
at MainScript.CalculateHD () [0x00000] in :0
at LoadChart.OnPress (Boolean isPressed) [0x00000] in :0
at UnityEngine.GameObject.SendMessage (System.String methodName, System.Object value, SendMessageOptions options) [0x00000] in :0
at UICamera.Notify (UnityEngine.GameObject go, System.String funcName, System.Object obj) [0x00000] in :0
at UICamera.ProcessRelease (Boolean isMouse, Single drag) [0x00000] in :0
at UICamera.ProcessTouch (Boolean pressed, Boolean released) [0x00000] in :0
at UICamera.ProcessTouches () [0x00000] in :0
at UICamera.Update () [0x00000] in :0
Rethrow as TypeInitializationException: The type initializer for ‘TZ4Net.ZoneInfo.Time’ threw an exception.
at TZ4Net.OlsonTimeZone…cctor () [0x00000] in :0
at MainScript.GetUTCDateTime (System.String pCountry, System.String pCity, System.String pYear, System.String pMonth, System.String pDay, System.String pTime) [0x00000] in :0
at MainScript.PopulateInputGates (System.String ChartType) [0x00000] in :0
at MainScript.PrepareInputGates () [0x00000] in :0
at MainScript.CalculateHD () [0x00000] in :0
at LoadChart.OnPress (Boolean isPressed) [0x00000] in :0
at UnityEngine.GameObject.SendMessage (System.String methodName, System.Object value, SendMessageOptions options) [0x00000] in :0
at UICamera.Notify (UnityEngine.GameObject go, System.String funcName, System.Object obj) [0x00000] in :0
at UICamera.ProcessRelease (Boolean isMouse, Single drag) [0x00000] in :0
at UICamera.ProcessTouch (Boolean pressed, Boolean released) [0x00000] in :0
at UICamera.ProcessTouches () [0x00000] in :0
at UICamera.Update () [0x00000] in :0
Rethrow as TypeInitializationException: The type initializer for ‘TZ4Net.OlsonTimeZone’ threw an exception.
at MainScript.GetUTCDateTime (System.String pCountry, System.String pCity, System.String pYear, System.String pMonth, System.String pDay, System.String pTime) [0x00000] in :0
at MainScript.PopulateInputGates (System.String ChartType) [0x00000] in :0
at MainScript.PrepareInputGates () [0x00000] in :0
at MainScript.CalculateHD () [0x00000] in :0
at LoadChart.OnPress (Boolean isPressed) [0x00000] in :0
at UnityEngine.GameObject.SendMessage (System.String methodName, System.Object value, SendMessageOptions options) [0x00000] in :0
at UICamera.Notify (UnityEngine.GameObject go, System.String funcName, System.Object obj) [0x00000] in :0
at UICamera.ProcessRelease (Boolean isMouse, Single drag) [0x00000] in :0
at UICamera.ProcessTouch (Boolean pressed, Boolean released) [0x00000] in :0
at UICamera.ProcessTouches () [0x00000] in :0
at UICamera.Update () [0x00000] in :0
UnityEngine.GameObject:SendMessage(String, Object, SendMessageOptions)
UICamera:Notify(GameObject, String, Object)
UICamera:ProcessRelease(Boolean, Single)
UICamera:ProcessTouch(Boolean, Boolean)
UICamera:ProcessTouches()
UICamera:Update()