[英]ExecutionEngineException: Attempting to JIT compile method
public class StaticDataContainer<T> where T : IStaticData {
protected static Dictionary<int, T> data;
public static void init(string jsonString){
//It work fine in Unity,But in Xcode iOS,it will show an error below:
//ExecutionEngineException: Attempting to JIT compile method
//'System.Collections.Generic.Dictionary`2<int, AD>:.ctor ()'
//while running with --aot-only.
data = new Dictionary<int, T> ();
I refer to: http://answers.unity3d.com/questions/250803/executionengineexception-attempting-to-jit-compile.html 我指的是: http : //answers.unity3d.com/questions/250803/executionengineexception-attempting-to-jit-compile.html
Your application makes use of some generic type that was missed during AOT compile. 您的应用程序利用了AOT编译期间遗漏的某些通用类型。 And solution is:The problem can usually be fixed by including a "dummy" class that references the missing types.
解决方法是:通常可以通过包含引用缺失类型的“虚拟”类来解决该问题。
But I dont' know what dummy class is. 但是我不知道什么是哑班。 How can I solve it?
我该如何解决?
Here's how I do it. 这是我的方法。 I create a file with name AOTDummy.cs in a project with following structure (adapted for your problem):
我在具有以下结构的项目中创建了一个名称为AOTDummy.cs的文件(适用于您的问题):
public static class AOTDummy
{
public static void Dummy()
{
System.Collections.Generic.Dictionary<int, AD> dummy01;
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.