Optimizations compile error - Not switched on all build targets

Whenever you toggle one of the optimizations, these compile error happens.

This means it’s not set on all the build targets, and therefor I can’t compile my project on macOS anymore.
I’m using the latest Pathfinding version and Unity 2018.1.3f1.

Thank you.


Ah. Yet another update to that list.
I haven’t figured out a way to get the list of actually valid build targets, so I have to keep a list of deprecated ones.
Try this:

Open the OptimzationHandler.cs file and add the lines

#if UNITY_2018_0_OR_NEWER
	(BuildTargetGroup)2, /* WebPlayer */
	(BuildTargetGroup)20, /* PSM */
	(BuildTargetGroup)22, /* SamsungTV */
	(BuildTargetGroup)24, /* WiiU */

to the definition of the deprecatedBuildTargets array. Let me know if that works.

Ah thank you. Will be home in a couple of hours to test it out. Will report back if any further issues happen. Thank you.

Same error still applies when adding the lines you mentioned. And you say just add them, not replace so that’s what I did.

So that gives this error upon compilation on macOS, since the optimizations aren’t applied

After adding the lines you need to press the ‘Apply’ button again. Did you do that?

Also. Have you removed the Poly2Tri and ClipperLib libraries?

Did press apply, yes, same errors after pressing apply. Log here

I have not removed those two libraries, no.

Hm… It might have to say UNITY_2018_1_OR_NEWER instead of UNITY_2018_0_OR_NEWER. Sorry for all these issues. I’m not able to test it myself right now.

Which optimizations are you trying to apply specifically?

Only the ASTAR_RECAST_LARGER_TILES for the spherical planets navmesh.
It worked with 2018_1_OR_NEWER, however still a fair bit of compile errors on the osx end of things.
Thank you for the help so far.

Ok. Because those compile errors have nothing to do with the optimizations. Can you verify that the Poly2Tri.dll, Pathfinding.Ionic.Zip.dll and ClipperLib.dll files are in the project and are configured to be included for the mac build target?

They all are

Oh wait! It seems like I’m missing the DLL on the OSX side?
Let me confirm.

Confirmed, I was (for some reason) missing the DLLs on the OSX side. It now compiles and works. Thank you for your patience.

1 Like

I’m glad it worked out!

And with the UNITY_2018_1_OR_NEWER change you no longer get error messages when pressing ‘Apply’?

I have to write 20 characters

1 Like

Last issue, I keep getting this.

Caught exception when loading from zip
Pathfinding.Ionic.Zip.ZipException: Cannot read that as a ZipFile ---> Pathfinding.Ionic.Zip.BadReadException:   Bad signature (0x00000001) at position  0x00000000
  at Pathfinding.Ionic.Zip.ZipEntry.ReadHeader (Pathfinding.Ionic.Zip.ZipEntry ze, System.Text.Encoding defaultEncoding) [0x00000] in <filename unknown>:0 
  at Pathfinding.Ionic.Zip.ZipEntry.ReadEntry (Pathfinding.Ionic.Zip.ZipContainer zc, Boolean first) [0x00000] in <filename unknown>:0 
  at Pathfinding.Ionic.Zip.ZipFile.ReadIntoInstance_Orig (Pathfinding.Ionic.Zip.ZipFile zf) [0x00000] in <filename unknown>:0 
  at Pathfinding.Ionic.Zip.ZipFile.ReadIntoInstance (Pathfinding.Ionic.Zip.ZipFile zf) [0x00000] in <filename unknown>:0 
  --- End of inner exception stack trace ---
  at Pathfinding.Ionic.Zip.ZipFile.ReadIntoInstance (Pathfinding.Ionic.Zip.ZipFile zf) [0x00000] in <filename unknown>:0 
  at Pathfinding.Ionic.Zip.ZipFile.Read (System.IO.Stream zipStream, System.IO.TextWriter statusMessageWriter, System.Text.Encoding encoding, System.EventHandler`1 readProgress) [0x00000] in <filename unknown>:0 
  at Pathfinding.Ionic.Zip.ZipFile.Read (System.IO.Stream zipStream) [0x00000] in <filename unknown>:0 
  at Pathfinding.Serialization.AstarSerializer.OpenDeserialize (System.Byte[] bytes) [0x00031] in C:\Users\NF Mynster\Documents\ASTROSMASH\Assets\AstarPathfindingProject\Core\Serialization\JsonSerializer.cs:490 
Pathfinding.Serialization.AstarSerializer:OpenDeserialize(Byte[]) (at Assets/AstarPathfindingProject/Core/Serialization/JsonSerializer.cs:494)
Pathfinding.AstarData:DeserializeGraphsAdditive(Byte[]) (at Assets/AstarPathfindingProject/Core/AstarData.cs:327)
Pathfinding.AstarData:DeserializeGraphs(Byte[]) (at Assets/AstarPathfindingProject/Core/AstarData.cs:312)
Pathfinding.AstarPathEditor:DeserializeGraphs(Byte[]) (at Assets/AstarPathfindingProject/Editor/AstarPathEditor.cs:1339)
Pathfinding.AstarPathEditor:DeserializeGraphs() (at Assets/AstarPathfindingProject/Editor/AstarPathEditor.cs:1333)
Pathfinding.AstarPathEditor:LoadGraphs() (at Assets/AstarPathfindingProject/Editor/AstarPathEditor.cs:1298)
Pathfinding.AstarPathEditor:OnEnable() (at Assets/AstarPathfindingProject/Editor/AstarPathEditor.cs:98)

And I’m not using any loading of the cache or what not.

Hm… You haven’t by any chance toggled the ASTAR_NO_ZIP option at any point?
When are you getting this?

I have not no. I got it upon starting up the editor, however it’s gone now, it was probably a mix between the optimizations not being applied, and the zip dlls not being there. It’s all good now.