#Mysterious build exceptions with no StackTrace

1 messages · Page 1 of 1 (latest)

deep quest
#

Hey, I'm continously getting two build errors in a big project with no way to debug them. Both from BuildPlayer in our PreBuildFunction.

The first is Assertion failed on expression: 'classAndNamespaceIndex.size() == 0', with no stacktrace other than BuildPlayer, presumably in some native code somewhere.
The second is:

ArgumentException: assemblyName
UnityEditor.RuntimeClassRegistry.AddSerializedClass (System.String assemblyName, System.String className) (at <41a751bfaf1d44859e9ae4cd25bf88bf>:0)
UnityEditor.DefaultBuildMethods:BuildPlayer(BuildPlayerOptions)

Which when I put a breakpoint on, shows UnityEngine.Events.UnityEvent`1 not having a set assembly-name, with the main part being within native code. I have 0 idea how to figure out what to actually do to fix this or how to make a smaller repro of it, does anybody have any ideas whatsoever? My current theory is an UnityEvent in a Serializable struct somewhere, but no idea how I'd even figure out where that is

#

This is an IL2CPP windows dev build with profiling support

dawn stirrup
deep quest
#

EditorLog had nothing different unfortunately

dawn stirrup
#

My hunch is that this has something to do with conditional compilation.
Maybe try searching for all instances of #if or #if UNITY_EDITOR and check if there are any blocks taht contain unity events.

deep quest
#

Finally figured it out, turned out to be a UnityEvent with a tuple in it, meaning serialized field with nested type arguments. Found it in this forum post from 2022, which means it's stayed unfixed for 3 years without any form of additional logging added to make it easier to find -_-
https://discussions.unity.com/t/build-error-in-2023-1-0a22/904003/2

wicked estuary