neuecc / ZeroFormatter

Infinitely Fast Deserializer for .NET, .NET Core and Unity.
MIT License
2.38k stars 249 forks source link

Unity IOS Crash On RegisterDictionary #72

Open antlaw opened 7 years ago

antlaw commented 7 years ago

I use ZeroFormatter in Unity and everything is fine in Unity Editor or when I compile it to Android. When I compile and run on iOS and I experience an run time exception as It tries to JIT compile mehtod. Can it be avoid by making it aot only? Anyone experience the same problem?

The following generated code causes problem: ZeroFormatter.Formatters.Formatter.RegisterDictionary<ZeroFormatter.Formatters.DefaultResolver, string, global::Model.Atlas.CfgIncident>(); Here is the run time error:

ExecutionEngineException: Attempting to JIT compile method 'ZeroFormatter.Formatters.Formatter2<ZeroFormatter.Formatters.DefaultResolver, System.Collections.Generic.KeyValuePair2<string, Model.Atlas.CfgIncident>>:get_Default ()' while running with --aot-only.

at ZeroFormatter.Formatters.Formatter.RegisterDictionary[DefaultResolver,String,CfgIncident] () [0x00000] in :0 at ZeroFormatter.ZeroFormatterInitializer.Register () [0x00000] in :0

(Filename: Line: -1)

serendipity251 commented 6 years ago

@antlaw I have the same problem, any solution on this ?

yosun commented 6 years ago

Great benchmarks but not usable by 2 million unity dev's for publish to iOS platform. C'mon!