0
\$\begingroup\$

I made a WebGL game and the first few times it built well, then I continued working on it a bit and when I build it it gives me an error (and does not generate the build files), error: FileNotFoundException:

Could not find file "C:\Users\Public\Documents\Unity Projects\Infinite Side Scroller\Temp\StagingArea\Data\Native\build.asm.js".

Heres the full error message:

FileNotFoundException: Could not find file "C:\Users\Public\Documents\Unity Projects\Infinite Side Scroller\Temp\StagingArea\Data\Native\build.asm.js". System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean anonymous, FileOptions options) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/FileStream.cs:305) System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share) (wrapper remoting-invoke-with-check) System.IO.FileStream:.ctor (string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare) System.IO.File.OpenRead (System.String path) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/File.cs:363) System.IO.StreamReader..ctor (System.String path, System.Text.Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/StreamReader.cs:167) System.IO.StreamReader..ctor (System.String path, System.Text.Encoding encoding) (wrapper remoting-invoke-with-check) System.IO.StreamReader:.ctor (string,System.Text.Encoding) System.IO.File.ReadAllText (System.String path, System.Text.Encoding encoding) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/File.cs:587) System.IO.File.ReadAllText (System.String path) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/File.cs:582) UnityEditor.WebGL.CodeAnalysisUtils.ReplaceDuplicates (System.String builtCodePath, Int32 interations) (at /Users/builduser/buildslave/unity/build/PlatformDependent/WebGL/Extensions/Unity.WebGL.extensions/CodeAnalysisUtils.cs:145) UnityEditor.WebGL.WebGlBuildPostprocessor.PostProcess (BuildPostProcessArgs args) (at /Users/builduser/buildslave/unity/build/PlatformDependent/WebGL/Extensions/Unity.WebGL.extensions/BuildPostprocessor.cs:589) UnityEditor.PostprocessBuildPlayer.Postprocess (BuildTarget target, System.String installPath, System.String companyName, System.String productName, Int32 width, Int32 height, System.String downloadWebplayerUrl, System.String manualDownloadWebplayerUrl, BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.BuildReporting.BuildReport report) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/PostprocessBuildPlayer.cs:186) UnityEditor.HostView:OnGUI()

What is the problem? And how can I fix it?

Feel free to ask me for more information?

Thanks in advance for the help!

\$\endgroup\$
8
  • \$\begingroup\$ this seems to be a unity bug \$\endgroup\$ Commented Jan 28, 2017 at 11:48
  • \$\begingroup\$ Related reading \$\endgroup\$ Commented Jan 28, 2017 at 12:06
  • 1
    \$\begingroup\$ It looks like you have some file access code in your game. You cannot call Filestream in WebGL. \$\endgroup\$ Commented Jan 28, 2017 at 17:07
  • \$\begingroup\$ What would be an common use of Filestream? (to give me an idea where I could have used it, since I'm not familiar with it) \$\endgroup\$ Commented Jan 29, 2017 at 10:55
  • \$\begingroup\$ Look for any reference to System.IO.FileStream in your code. \$\endgroup\$ Commented Jan 29, 2017 at 12:52

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.