iPhone crashes

For those of you experiencing crashes on startup when running the A* Pathfinding Project on iPhone here’s a workaround.

The background is that, even though it in the Unity docs appears to be supported, the System.Guid class isn’t supported on IOS. The A* Pathfinding Project uses that class for saving an ID for each graph.

In all graphs there is a variable initialized to new Guid () (in the base.cs script). This will, since it is not supported, crash the application.

For 3.1 I will write a replacement class for the Guid class, until then, here are two different workarounds.

Option one: In the player settings (Project Settings -> Player Settings) there is an option to catch all exceptions or crash on exceptions (the crash option yields faster applications).  If you set it to catch all exceptions, I think it will run ok.

Option 2: One variable almost at the top of the base.cs script is initialized to new Guid (). You can comment out that variable (it’s obsolete anyway). And it will hopefully not crash again.

Note that you will not be able to create new graphs during runtime even with these changes applied, that will create a new Guid and crash the application.

Hope it will work for all of you 😀

Leave a Reply

Your email address will not be published. Required fields are marked *