Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
2
Question by XrhstosMarth · Feb 01, 2021 at 12:18 PM · error build

Errors on building

i tried building a game on unity 2020.2.2f1. Everything works perfect in the editor with no warnings or error but when i try to build it it gives me a lot of errors like these :

  • Unhandled exception. System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. UnityEditor.BuildPlayerWindow:BuildPlayerAndRun ()

  • ---> System.IO.DirectoryNotFoundException: Could not find a part of the path 'D:\Unity\Unity Projects\LEXIS GAME\Library\ScriptAssemblies\Assembly-CSharp.dll'. UnityEditor.BuildPlayerWindow:BuildPlayerAndRun ()

  • at System.IO.FileStream.ValidateFileHandle(SafeFileHandle fileHandle) UnityEditor.BuildPlayerWindow:BuildPlayerAndRun ()

  • at System.IO.FileStream.CreateFileOpenHandle(FileMode mode, FileShare share, FileOptions options) UnityEditor.BuildPlayerWindow:BuildPlayerAndRun ()

  • at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options) UnityEditor.BuildPlayerWindow:BuildPlayerAndRun ()

  • at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share) UnityEditor.BuildPlayerWindow:BuildPlayerAndRun ()

*Error building Player: 38 errors

*Build completed with a result of 'Failed' in 11 seconds (10911 ms) UnityEditor.BuildPlayerWindow:BuildPlayerAndRun ()

and so on...anyone knows why do i keep getting all these errors when i get none in editor ??? (btw im trying to build it on windows)

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
3

Answer by GDGames0302 · Feb 01, 2021 at 06:35 PM

Hi. I'm not sure if I can help you, but I was getting errors on build because the project/package name contained whitespaces. The project name should not contain any whitespaces or punctuation marks.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image DTGraveyard · Jun 26, 2021 at 10:50 PM 0
Share

I had the same problem. I had an apostrophe in my project name, and when I changed my project name, it worked again. https://support.unity.com/hc/en-us/articles/115000086383-How-do-I-change-my-Project-s-name-

avatar image
0

Answer by Nugget184 · Jul 21, 2021 at 02:55 AM

I have the same problem if I press build and run. If I press "build", then it builds, but when I try to open the game, it opens for a second, than some unity error screen loads up, as shown in the image below, then it closes, and then the unity game gets unresponsive, then unexpectedly closes. I have no whitespace or any form of punctuation in my current game and my other game with whitespace was build perfectly fine. Is there another way to fix this? When I try to build and run, it says "UnityEditor.BuildPlayerWindow + BuildMethodException: 41 Errors. Here are my errors shown in the console.

Unhandled exception. System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. UnityEditor.BuildPlayerWindow:BuildPlayerAndRun ()

---> System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Josh\Website\Joshs Unity games and code\Unity Online Multiplayer FPS Game\Library\ScriptAssemblies\Assembly-CSharp.dll'. UnityEditor.BuildPlayerWindow:BuildPlayerAndRun ()

at System.IO.FileStream.ValidateFileHandle(SafeFileHandle fileHandle) UnityEditor.BuildPlayerWindow:BuildPlayerAndRun ()

at System.IO.FileStream.CreateFileOpenHandle(FileMode mode, FileShare share, FileOptions options) UnityEditor.BuildPlayerWindow:BuildPlayerAndRun ()

at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options) UnityEditor.BuildPlayerWindow:BuildPlayerAndRun ()

at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share) UnityEditor.BuildPlayerWindow:BuildPlayerAndRun ()

at Mono.Cecil.ModuleDefinition.GetFileStream(String fileName, FileMode mode, FileAccess access, FileShare share) UnityEditor.BuildPlayerWindow:BuildPlayerAndRun ()

at Mono.Cecil.ModuleDefinition.ReadModule(String fileName, ReaderParameters parameters) UnityEditor.BuildPlayerWindow:BuildPlayerAndRun ()

at Mono.Cecil.AssemblyDefinition.ReadAssembly(String fileName, ReaderParameters parameters) UnityEditor.BuildPlayerWindow:BuildPlayerAndRun ()

at TypeDbJsonGenerator.Program.<>c_DisplayClass4_0.b_1(String x) UnityEditor.BuildPlayerWindow:BuildPlayerAndRun ()

at System.Linq.Enumerable.WhereSelectArrayIterator`2.ToList() UnityEditor.BuildPlayerWindow:BuildPlayerAndRun ()

at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source) UnityEditor.BuildPlayerWindow:BuildPlayerAndRun ()

at TypeDbJsonGenerator.Program.Read(String[] pathToAssembly, String[] searchDirs) UnityEditor.BuildPlayerWindow:BuildPlayerAndRun ()

at TypeDbJsonGenerator.Program.Main(String[] args) UnityEditor.BuildPlayerWindow:BuildPlayerAndRun ()

--- End of inner exception stack trace --- UnityEditor.BuildPlayerWindow:BuildPlayerAndRun ()

at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions) UnityEditor.BuildPlayerWindow:BuildPlayerAndRun ()

at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) UnityEditor.BuildPlayerWindow:BuildPlayerAndRun ()

at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) UnityEditor.BuildPlayerWindow:BuildPlayerAndRun ()

at Program.Main(String[] args) UnityEditor.BuildPlayerWindow:BuildPlayerAndRun ()

---> System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Josh\Website\Joshs Unity games and code\Unity Online Multiplayer FPS Game\Library\PlayerScriptAssemblies\Assembly-CSharp.dll'. UnityEditor.BuildPlayerWindow:BuildPlayerAndRun ()

Error building Player: 38 errors

Build completed with a result of 'Failed' in 11 seconds (10563 ms) UnityEditor.BuildPlayerWindow:BuildPlayerAndRun ()

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 UnityEditor.BuildPlayerWindow:BuildPlayerAndRun ()

alt text


unityerror.png (11.8 kB)
Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

113 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Error building Player: CommandInvokationFailure: Failed to re-package resources. See the Console for details. 0 Answers

Firebase Analytics Unity Problem to build an Android apk 0 Answers

4 errors after implementing unity ads in my game. 0 Answers

Gladle initialization failed 0 Answers

Unity can't build and run 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges