- Home /
Game works fine in editor, but build fails with 59 error in the console
My game works fine and as expected in the unity editor, but upon building i get a ton of errors. These are the last ones:
Error building Player: 38 errors
Build completed with a result of 'Failed' in 8 seconds (8430 ms)
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
UnityEditor.BuildPlayerWindow+BuildMethodException: 41 errors
at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x002ca] in :0
at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x00080] in :0
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
Also this error keeps repeating itself:
Assertion failed on expression: 'false'
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
Honorable mentions:
Unhandled exception. System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
---> System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Users\(directory)\Documents\UnityGamesProjects\(game)\Library\ScriptAssemblies\Assembly-CSharp.dll'.
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
at System.IO.FileStream.ValidateFileHandle(SafeFileHandle fileHandle)
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
at System.IO.FileStream.CreateFileOpenHandle(FileMode mode, FileShare share, FileOptions options)
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
Edit: don't know if it helps, but i had put the unity project in the recycle bin without emptying it and removed it from unity hub due to stress and stuff not working correctly. once i figured out what to do, i restored the folder to the original location and re-added it in unity hub. then it couldn't build. i haven't tried building it before i deleted it, but i can try building a different project to see if my pc is the problem, unity or just that project
Are you sure that build is created correctly, without erros?
the build is created, and the character works fine, but due to the animations being rotated -90 on the x with no way to change it, i have set a rotation on LateUpdate to fix it. In the build, the animations don't work, so the character just keeps spinning on the X axis.
update, i changed to the latest version but now it directly fails the build
can you manually locate the "C:\Users(directory)\Documents\UnityGamesProjects(game)\Library\ScriptAssemblies\Assembly-CSharp.dll" dll? also make sure the directoy and game doesnt have special characters
and there are no spaces or special characters in the path?
Try deleting the Library Folder and reopen the Projekt. The Library Folder gets recreated automatically. The Files are all autogenerated. $$anonymous$$aybe a fresh recreation of those files can help.
there SEE$$anonymous$$ to be different errors, but there's still the "assertion failed on expression 'false'" error repeating itself.
Answer by DaniArkadia · Feb 15, 2021 at 12:12 PM
For anyone who might be stuck with this in the future:
The issue in this case was that AnimationClips in the models import settings didn't have any names, so the animations weren't attaching correctly when building the game. So go into the model import settings > animations and make sure that all clips are named before using them.
Answer by Rbrinks · May 20, 2021 at 07:40 PM
For anyone who's still stuck, for me the solution was making sure there's no unusual characters in your folder names.
My game had a an ' in it and removing that from one of the folder names solved everything.
Holy moly, it took me a while to see this was the answer for me. When the path is built to do all the import stuff, the ' gets removed so your path is not found anymore, if it was part of the project's name for example.
Your answer
Follow this Question
Related Questions
Hierarchy not showing anything, getting KeyNotFoundException 1 Answer
My android app build has more bugs on it than the editor/deveploment version 0 Answers
Unity Hangs when compiling after the 1st run 2 Answers
Unity Editor's Inspector Glitch while using OnGUI function 0 Answers
Sphere disappear after build 0 Answers