Why i'm getting exception in the editor: Assertion failed: Assertion failed on expression ?

Assertion failed: Assertion failed on expression: ‘!(name.size() == 1 && name[0] == ‘/’)’

What does it mean and how should/can i fix it ?
It’s not giving me any line number in a script and not avoiding me from running the game.

I’m using the ‘/’ as string in one of my scripts.
But i’m also using other strings but getting the exception only on this.

And this: Assertion failed: Assertion failed on expression: ‘!(name.size() == 1 && name[0] == ‘.’)’

Select the drop-down in the upper right of your console, and select “Stack Trace Logging → All → Full”. That’ll give you the full stack trace of the error.

Internal asserts like that are either because there’s a bug in Unity, or because Unity’s error reporting is insufficient. We’re not supposed to see them. The stack trace should give a good indication of what part of the engine is doing it, though.

Note that getting full stack traces is really slow, so be sure to turn it off again when you’re finished!

2 Likes

The result:

The tree Hello World couldn’t be instanced because the prefab contains no valid mesh renderer.
0x000000014098D85B (Unity) StackWalker::GetCurrentCallstack
0x0000000140990E0F (Unity) StackWalker::ShowCallstack
0x0000000140D36CE0 (Unity) GetStacktrace
0x000000014107C036 (Unity) DebugStringToFile
0x000000014107C80C (Unity) DebugStringToFile
0x000000014156D89D (Unity) TreeDatabase::Prototype::Set
0x0000000141573EFE (Unity) TreeDatabase::RefreshPrototypes
0x0000000141573FA2 (Unity) TreeDatabase::SetTreePrototypes
0x000000014183A8F5 (Unity) TerrainData_Set_Custom_PropTreePrototypes
0x000000000B003F55 (Mono JIT Code) (wrapper managed-to-native) UnityEngine.TerrainData:set_treePrototypes (UnityEngine.TreePrototype[ ])
0x000000000B003927 (Mono JIT Code) [TerrainWizards.cs:386] UnityEditor.TreeWizard:smile:oApply ()
0x000000000B0033F7 (Mono JIT Code) [TerrainWizards.cs:402] UnityEditor.TreeWizard:OnWizardCreate ()
0x0000000011C36C42 (Mono JIT Code) (wrapper runtime-invoke) object:runtime_invoke_void__this__ (object,intptr,intptr,intptr)
0x00007FF824D65EDF (mono) [mini.c:4937] mono_jit_runtime_invoke
0x00007FF824CB8731 (mono) [object.c:2623] mono_runtime_invoke
0x00007FF824CBEC3F (mono) [object.c:3838] mono_runtime_invoke_array
0x00007FF824C7D0F7 (mono) [icall.c:2750] ves_icall_InternalInvoke
0x0000000011C00257 (Mono JIT Code) (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (object,object[ ],System.Exception&)
0x0000000011BFE3B2 (Mono JIT Code) [MonoMethod.cs:222] System.Reflection.MonoMethod:Invoke (object,System.Reflection.BindingFlags,System.Reflection.Binder,object[ ],System.Globalization.CultureInfo)
0x0000000011CE9EEF (Mono JIT Code) [MethodBase.cs:115] System.Reflection.MethodBase:Invoke (object,object[ ])
0x000000000AFAD9C2 (Mono JIT Code) [ScriptableWizardBindings.gen.cs:83] UnityEditor.ScriptableWizard:OnGUI ()
0x0000000011C36C42 (Mono JIT Code) (wrapper runtime-invoke) object:runtime_invoke_void__this__ (object,intptr,intptr,intptr)
0x00007FF824D65EDF (mono) [mini.c:4937] mono_jit_runtime_invoke
0x00007FF824CB8731 (mono) [object.c:2623] mono_runtime_invoke
0x00007FF824CBEC3F (mono) [object.c:3838] mono_runtime_invoke_array
0x00007FF824C7D0F7 (mono) [icall.c:2750] ves_icall_InternalInvoke
0x0000000011C00257 (Mono JIT Code) (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (object,object[ ],System.Exception&)
0x0000000011BFE3B2 (Mono JIT Code) [MonoMethod.cs:222] System.Reflection.MonoMethod:Invoke (object,System.Reflection.BindingFlags,System.Reflection.Binder,object[ ],System.Globalization.CultureInfo)
0x0000000011CE9EEF (Mono JIT Code) [MethodBase.cs:115] System.Reflection.MethodBase:Invoke (object,object[ ])
0x0000000032E0AD95 (Mono JIT Code) [HostView.cs:272] UnityEditor.HostView:Invoke (string,object)
0x0000000032E0AC3A (Mono JIT Code) [HostView.cs:265] UnityEditor.HostView:Invoke (string)
0x000000000AFAC182 (Mono JIT Code) [HostView.cs:94] UnityEditor.HostView:OnGUI ()
0x0000000011C36C42 (Mono JIT Code) (wrapper runtime-invoke) object:runtime_invoke_void__this__ (object,intptr,intptr,intptr)
0x00007FF824D65EDF (mono) [mini.c:4937] mono_jit_runtime_invoke
0x00007FF824CB8731 (mono) [object.c:2623] mono_runtime_invoke
0x000000014140BF25 (Unity) scripting_method_invoke
0x0000000141403FE1 (Unity) ScriptingInvocation::Invoke
0x000000014103E283 (Unity) MonoBehaviourDoGUI
0x0000000141030AE0 (Unity) IMGUIModule::MonoBehaviourDoGUI
0x0000000141175D8D (Unity) MonoBehaviour::smile:oGUI
0x0000000140029F96 (Unity) GUIView::OnInputEvent
0x00000001401B1753 (Unity) GUIView::ProcessInputEvent
0x0000000140006B51 (Unity) GUIView::ProcessEventMessages
0x000000014002DA25 (Unity) GUIView::GUIViewWndProc
0x00007FF84566BC50 (USER32) CallWindowProcW
0x00007FF84566B5CF (USER32) DispatchMessageW
0x0000000141A8A7EA (Unity) MainMessageLoop
0x0000000141A8C15E (Unity) WinMain
0x0000000141CEF53C (Unity) __tmainCRTStartup
0x00007FF8454E2774 (KERNEL32) BaseThreadInitThunk
0x00007FF845F80D51 (ntdll) RtlUserThreadStart