Need help with build errors - Text101 course

Trigger warning, wall of text ahead… I simply copied and pasted the error messeges I get when building the WebGL game. I really hope someone can make sense of this. I followed every step of the course very accurately, it really bums me that the end result isn’t working. (Using Unity 2020.2.6f1)

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 ‘D:\Bobs Kunst\2021\Repos\Unity2D\Fruitsday\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&)

at System.IO.FileStream…ctor(String path, FileMode mode, FileAccess access, FileShare share)
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

at Mono.Cecil.ModuleDefinition.GetFileStream(String fileName, FileMode mode, FileAccess access, FileShare share)
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

at Mono.Cecil.ModuleDefinition.ReadModule(String fileName, ReaderParameters parameters)
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

at Mono.Cecil.AssemblyDefinition.ReadAssembly(String fileName, ReaderParameters parameters)
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

at TypeDbJsonGenerator.Program.<>c__DisplayClass4_0.b__1(String x)
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

at System.Linq.Enumerable.WhereSelectArrayIterator`2.ToList()
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

at TypeDbJsonGenerator.Program.Read(String pathToAssembly, String searchDirs)
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

at TypeDbJsonGenerator.Program.Main(String args)
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

— End of inner exception stack trace —
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

at System.RuntimeMethodHandle.InvokeMethod(Object target, Object arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object parameters, CultureInfo culture)
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

at System.Reflection.MethodBase.Invoke(Object obj, Object parameters)
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

at Program.Main(String args)
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

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 ‘D:\Bobs Kunst\2021\Repos\Unity2D\Fruitsday\Library\PlayerScriptAssemblies\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&)

at System.IO.FileStream…ctor(String path, FileMode mode, FileAccess access, FileShare share)
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

at Mono.Cecil.ModuleDefinition.GetFileStream(String fileName, FileMode mode, FileAccess access, FileShare share)
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

at Mono.Cecil.ModuleDefinition.ReadModule(String fileName, ReaderParameters parameters)
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

at Mono.Cecil.AssemblyDefinition.ReadAssembly(String fileName, ReaderParameters parameters)
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

at TypeDbJsonGenerator.Program.<>c__DisplayClass4_0.b__1(String x)
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

at System.Linq.Enumerable.WhereSelectArrayIterator`2.ToList()
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

at TypeDbJsonGenerator.Program.Read(String pathToAssembly, String searchDirs)
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

at TypeDbJsonGenerator.Program.Main(String args)
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

— End of inner exception stack trace —
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

at System.RuntimeMethodHandle.InvokeMethod(Object target, Object arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object parameters, CultureInfo culture)
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

at System.Reflection.MethodBase.Invoke(Object obj, Object parameters)
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

at Program.Main(String args)
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

Error building Player: 38 errors

Build completed with a result of ‘Failed’ in 12 seconds (11827 ms)
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

UnityEditor.BuildPlayerWindow+BuildMethodException: 41 errors
at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x002ca] in <8c48e4bc2ff34638b69095cbb65e2e27>:0
at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x00080] in <8c48e4bc2ff34638b69095cbb65e2e27>:0
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

Hi GreenRanger,

Thank you for sharing the output in your console.

Here are a few suggestions:

  1. Save your build on your harddrive but not inside your project folder, on your Desktop or in a cloud.
  2. Use English characters (A-Z, a-z, 0-9) only for your file and folder names.
  3. Remove all scenes from the Build Settings list and readd them.
  4. Make sure that neither your firewall nor your antivirus program block Unity.
  5. Run Unity with administrator rights.
  6. Update Unity to a newer stable version.

Did any of these help?


See also:

1 Like

Hi Nina,

Thanks for your reply!
I tried all of your suggestions and none fix the problem.
I was already running the latest stable version, I removed all characters and spacebars in my assets and my firewall wasn’t blocking Unity. Unchecking the scenes in te build settings also didn’t work.

I also triend making a brand new project and copy pasting my assets. Still the same errors. Even got the same errors after resetting all the options in the player settings to default in the build menu.

When I run the game in Unity itself everything is fine, 0 bugs whatsoever.

Alright, I fixed it! :smiley:

What I did:

  1. Uninstall everything Unity related
  2. Download Unity hub again
  3. Install an older long term support version (2019.4.21f1)
  4. Make the project again with copy pasting everything…
  5. Cry from happiness when the build finished succesfully

Now I can continue with the rest of the course knowing that this wasn’t my fault in any way.

Good job! Sometimes, Unity is just buggy. Reinstalling usually helps in that case.

1 Like

On my way to become a true problem solver :sunglasses:

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms