- Home /
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
Your application makes use of some generic type that was missed during AOT compile. 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?
Answer by Siyuan · Apr 09, 2015 at 11:42 AM
According to this answer http://answers.unity3d.com/questions/30930/why-did-my-binaryserialzer-stop-working.html 
Just add following code into one of your Awake() function to solve the problem
  if (Application.platform == RuntimePlatform.IPhonePlayer)
          {
              System.Environment.SetEnvironmentVariable("MONO_REFLECTION_SERIALIZER", "yes");
          } 
Your answer
 
 
             Follow this Question
Related Questions
can't run game through xcode; works when launched from iphone 1 Answer
Mono Error when compiling scripts 1 Answer
Unity IL2CPP 0 Answers
ArgumentException: get_value can only be called from the main thread 3 Answers
Using List.Count on Unity iPhone 2 Answers
 koobas.hobune.stream
koobas.hobune.stream 
                       
                
                       
			     
			 
                