A* Pathfinding Project

IOS ExecutionEngineException


#1

I get an error on iphone at the time the grid was created:

System.ExecutionEngineException: Attempting to JIT compile method ‘System.Collections.Generic.GenericEqualityComparer’1 < Pathfinding.int3`1 > :.ctor ()’

I tried to move the file link.xml to the root folder Assets / Errors still exit.


#2

Hi

Which version are you using?


#3

Astar 4.1.1, unity 5.6.4p4


#4

Hi

Hm. Weird. I would have thought that was resolved at least in version 4.0.
Try this:

Open the AstarMath.cs file and find the line

static readonly Dictionary<Int3, int> cached_Int3_int_dict = new Dictionary<Int3, int>();

Replace that line with

class IEq : IEqualityComparer<Int3> {
	public bool Equals (Int3 a, Int3 b) {
		return a == b;
	}

	public int GetHashCode (Int3 p) {
		return p.GetHashCode ();
	}
}

/** Cached dictionary to avoid excessive allocations */
static readonly Dictionary<Int3, int> cached_Int3_int_dict = new Dictionary<Int3, int>(new IEq());

and see if that works. If you get an error again, double check to make sure it is the exact same error and not just similar one.