Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When I try to compile my Unity project to WebGL in Development mode on Windows 8.1 (and with the latest version of Unity), I receive the following errors (the first one is truncated because it's really long; I can post it upon request).

DirectoryNotFoundException: Destination directory not found: Temp/StagingArea/Data/Resources
System.IO.File.Copy (System.String sourceFileName, System.String destFileName, Boolean overwrite)...

Error building Player: DirectoryNotFoundException: Destination directory not found: Temp/StagingArea/Data/Resources

There's no output; the directory I'm attempting to build my project in is empty. A forum post somewhere suggested I run Unity in Administrator mode, but if that had worked I wouldn't be posting here for help.

share|improve this question

First of all make sure you can make a WebGL build with your currently installed Unity version. Create a new project with a new scene, add it to the build settings and make a WebGL build. If this does not work the problem is not project specific.

If it works try one of these possible solutions.

Possible solution 1:

  1. Check your WebGL Build Settings
  2. Make a fresh build (unique folder)

Possible solution 2:

  1. BACKUP your project
  2. Close Unity
  3. Delete the folders -> Library, Temp in the root of the project directory to force Unity to rebuild them on next launch.
  4. BUILD

Possible solution 3:

  1. Create a new Unity Project
  2. Copy OldProject/Assets to NewPoject/Assets
  3. Copy OldProject/ProjectSettings to NewProject/ProjectSettings
  4. BUILD
share|improve this answer
    
Isn't #3 the same as #2? – JesseTG Jan 2 at 20:52
    
#3 is to make sure there are no old hidden cached whatever stuff left. I would like to say it's the same as #2, but I have seen cases where it's not. – Mattias Jan 2 at 20:57
    
So I have to basically make a brand new project? – JesseTG Jan 2 at 21:08
    
Well. Creating a new Unity project and adding your files is not that big of a deal. This is just to get rid of temporary data or settings making your build fail. To clarify, you don't need to have two different projects as long as you don't use platform specific code that is not supported by WebGL. – Mattias Jan 2 at 21:15
1  
Well given the chat log I guess the solution was to remove uses of System.IO, which is unsupported with WebGL? I suggest posting this as an anwser (or as solution 4), see if the OP accepts it. – Laurent Couvidou Jan 4 at 13:03

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.