Optimizations compile error - Not switched on all build targets


#1

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.


#2

Hi

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 */
#endif

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


#3

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.


#4

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


#5

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


#6

Also. Have you removed the Poly2Tri and ClipperLib libraries?


#7

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


I have not removed those two libraries, no.


#8

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.


#9

Which optimizations are you trying to apply specifically?


#10

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.


#11

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?


#12

They all are


#13

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


#14

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


#15

Nice!
I’m glad it worked out!


#16

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


#17

Correct!
I have to write 20 characters


#18

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 
UnityEngine.Debug:LogError(Object)
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.


#19

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


#20

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.