[Solved]Having trouble compiling a build for WebGL Temp/StagingArea/Data/Resources not being created

I have a WebGL app I have been working on, I recently updated to 5.3 on Unity, this also happens on the cloud build for webGL, same source code, but I don’t see what or where issue possibly came from as the code hasn’t changed between before and the update.

I was hoping someone had come across this before and they found a way of debugging/found out how to fix it, Google is not helping me as much as I hoped.

These are the 2 errors I get each build.

DirectoryNotFoundException: Destination directory not found: Temp/StagingArea/Data/Resources
System.IO.File.Copy (System.String sourceFileName, System.String destFileName, Boolean overwrite) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.IO/File.cs:120)
System.IO.File.Copy (System.String sourceFileName, System.String destFileName) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.IO/File.cs:86)
UnityEditor.WebGL.WebGlBuildPostprocessor.PostProcess (BuildPostProcessArgs args) (at /Users/builduser/buildslave/unity/build/PlatformDependent/WebGL/Extensions/Unity.WebGL.extensions/BuildPostprocessor.cs:292)
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) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/PostprocessBuildPlayer.cs:316)
UnityEditor.HostView:OnGUI()

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

Also yes I know it means a directory isn’t there and it isn’t the only two items in that directory are
./Managed
./data.unity3d

I guess i’m asking what could possibly stop the Resources folder from being made, an issue with a shader, library or even the main source code? The build in the editor works fine with no issues, so I’m really stumped right now.

Any ideas?

I have just found out this happens for windows and Mac builds too however they complete fully but crash because there is no resources to load.

Okay so after hours of experimenting and do whatever I could to my project.

I made sure all file copying software like Dropbox was disabled, although doing this alone didn’t change anything so probably isn’t relevant.

I swear I had done this two or three times before but didn’t seem to make a difference however it started to build properly again after deleting Library, obj, ProjectSettings, Temp in the root of the project directory while Unity was closed. Booted Unity and it rebuilt them folders, I lost some project settings but nothing too major that I can’t figure what they were previously.

Just thought I should put a solved for me reply here for others in the future.

One last further not, I reviewed the only files that changed on my commit as that is what the cloud build uses, the only files that changed where the ProjectSettings assets. So I did some further investigating, it turns out my GraphicsSettings.Asset file was the problem

I set all three shader types to Not Supported, which will obviously break everything, changed Deffered to Built-in Shader and it worked fine, I do recall playing with this but didn’t think that it would cause such a problem that the build would fail at least without a better described error.

Anyway fixed now and I found out what my problem was all happy

1 Like

Thanks for looking into this! I encountered this problem as well a couple of times now. I tend to disable everything for WebGL…