Hey!
First, I’m a long time fan and a user of this framework. I love it!
But I’m compiling a webGL version of my new project and suddenly I’m encountering a new bug…
This happens when a built project is run in a browser. Just when it’s loaded, on start.
Caught exception while deserializing data. System.MissingMethodException: Default constructor not found for type Pathfinding.GridGraph at System.RuntimeType.CreateInstanceMono (System.Boolean nonPublic) [0x00000] in <00000000000000000000000000000000>:0 at System.RuntimeType.CreateInstanceSlow (System.Boolean publicOnly, System.Boolean skipCheckThis, System.Boolean fillCache, System.Threading.StackCrawlMark& stackMark) [0x00000] in <00000000000000000000000000000000>:0 at System.RuntimeType.CreateInstanceDefaultCtor (System.Boolean publicOnly, System.Boolean skipCheckThis, System.Boolean fillCache, System.Threading.StackCrawlMark& stackMark) [0x00000] in <00000000000000000000000000000000>:0 at System.Activator.CreateInstance (System.Type type, System.Boolean nonPublic) [0x00000] in <00000000000000000000000000000000>:0 at System.Activator.CreateInstance (System.Type type) [0x00000] in <00000000000000000000000000000000>:0 at Pathfinding.AstarData.CreateGraph (System.Type type) [0x00000] in <00000000000000000000000000000000>:0 at Pathfinding.Serialization.AstarSerializer.DeserializeGraph (System.Int32 zipIndex, System.Int32 graphIndex, System.Type availableGraphTypes) [0x00000] in <00000000000000000000000000000000>:0 at Pathfinding.Serialization.AstarSerializer.DeserializeGraphs (System.Type availableGraphTypes) [0x00000] in <00000000000000000000000000000000>:0 at Pathfinding.AstarData.DeserializeGraphsPartAdditive (Pathfinding.Serialization.AstarSerializer sr) [0x00000] in <00000000000000000000000000000000>:0 at Pathfinding.AstarData.DeserializeGraphsAdditive (System.Byte bytes) [0x00000] in <00000000000000000000000000000000>:0 at Pathfinding.AstarData.DeserializeGraphs (System.Byte bytes) [0x00000] in <00000000000000000000000000000000>:0 at Pathfinding.AstarData.DeserializeGraphs () [0x00000] in <00000000000000000000000000000000>:0 at Pathfinding.AstarData.Awake () [0x00000] in <00000000000000000000000000000000>:0 at AstarPath.InitializeAstarData () [0x00000] in <00000000000000000000000000000000>:0 at AstarPath.Awake () [0x00000] in <00000000000000000000000000000000>:0 UnityEngine.DebugLogHandler:Internal_Log(LogType, LogOption, String, Object) UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object) UnityEngine.Logger:Log(LogType, Object) UnityEngine.Debug:LogError(Object) Pathfinding.AstarData:DeserializeGraphsAdditive(Byte) Pathfinding.AstarData:DeserializeGraphs(Byte) Pathfinding.AstarData:DeserializeGraphs() Pathfinding.AstarData:Awake() AstarPath:InitializeAstarData() AstarPath:Awake() (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 48)
My first instinct was to add the link.xml file that you mentioned in the tutorial to the assets folder. I’ve also added that FAST_NOEXCEPTIONS definition in JsonSerializer and AstarData just in case. But it’s not working…
I’ve tried disabling Strip Engine Code in Player settings. It seems to be the only solution, but the project size suffers a lot…
Edit - a debug webgl build runs okay, no errors on Strip Engine Code and Stripping Level Low. However, building a not-development build seems to mess that up?
Edit 2- seems like WebAssembly Streaming option in Player settings was causing a problem for some strange reason…
Edit3- I wish building these projects took less time, but here we are. The optimal Player settings for webGL un Unity with A* is Strip Engine Code On, Stripping Level Low and WebAssembly Streaming turned off!
This was a nice case of rubber duck testing