Errors when deploying to PS4

Hey guys,

I’m using A* Pathfinding project in Unity 5, making a game for PC and PS4. The game seems fine on PC, but the PS4 version seems to get the following error:
ExecutionEngineException: Attempting to JIT compile method ‘(wrapper managed-to-native) System.Threading.Interlocked:Exchange (Pathfinding.Path&,Pathfinding.Path)’ while running with --aot-only.

Also it’s repeating showing this message:
Canceled path because a new one was requested.
This happens when a new path is requested from the seeker when one was already being calculated.
For example if a unit got a new order, you might request a new path directly instead of waiting for the now invalid path to be calculated. Which is probably what you want.
If you are getting this a lot, you might want to consider how you are scheduling path requests.

It’s not stopping the game, but I’m concerned about the log messages. Is there something specific I have to do for PS4?

Thanks,

JW

Anyone else developing for the PS4 and using A*?

Found a fix for the error messages.

In LockFreeStack.cs, add UNITY_PS4 to all the preprocessor statements.

1 Like

Hi

Sorry for the late answer.
Yeah, that bug was reported to me a month ago as well, I have fixed it in my local development version so it will be fixed in the next update. The fix was, as you have already discovered, to add UNITY_PS4 to the LockFreeStack script.