Cannot build for WebGL in Unity

I have given it a different project name TerminalHack instead of TerminalHacker.

Now I have removed every trace of unity except for my project files and installed it again. I have installed:

  1. Unity Hub v. 0.20.1
  2. Unity 2018.2.7f1 (with WebGL Build Support and Windows Build Support)
  3. Also selected to install Microsoft Visual Studio Community 2017 during Unity install

After this was done I did the following:

  1. Created a new 2D project named TH in D:\Repos\Unity3D\2_Terminal_Hacker\ with enabled Unity Analytics
  2. Built a WebGL Build (SUCCESS)
  3. Deleted the build files
  4. Downloaded asset files from the course and added them to the project
  5. Drag the prefab to the hierarchy.
  6. Built a WebGL Build (FAIL)

very weird.

Ok, Iā€™ll kick off the download for 2018.2.7f1 and give you repro steps a go, lets see what happens at this endā€¦ will take a little while to download Unity obviously, will reply back here in due course.

On a positive note, at least you know you can build for WebGL, so thatā€™s a bonus.

Thanks again for your effort, Rob. If we donā€™t solve it I think I will continue with the course and hope that my setup works better with other assets later on. It all works fine until I import the assets from the course. Itā€™s all very confusing to me.

I am going to be away from my computer this evening. I am running a 10k race dressed as Fred Flintstone tonight. :running_man:

Followed all the steps to build the new project so far, but my laptop is - again - maxed out on CPUā€¦ Norton and Unity are really having some issuesā€¦ so Iā€™m not sure how long this initial build will take. Will have to see about resolving this issue myself later and its a real painā€¦

I am hoping to getting to the point of importing the assets and testing this properly soon!

One thing which struck me was your mention of Unity Analytics, again, something else worth a try perhaps, e.g. create the project without that enabled, add the assets for TH and then see what happens.

I am running a 10k race dressed as Fred Flintstone tonight.

As you do! :smiley: Good luck with the race, 10k, thatā€™s no small effort :slight_smile:


Updated Sat Sep 08 2018 18:09

Slapped the laptop back into orderā€¦

Okā€¦ so following on from the repo stepsā€¦

  • empty project - built - all good
  • imported WM2000 asset package - built - all good
  • dragged WM2000 prefab into scene - built - all good (using default SampleScene)

I didnā€™t indicate on the Unity install to include Visual Studio, in fact, I donā€™t recall the option, but thatā€™s probably because it detected it was already installed - unless it was greyed out and I just didnā€™t see it. I did choose the same platform support as yourself though.

Iā€™m having the same issue trying to compile my beginning Hacker program to WebGL. Iā€™ll see if I can upload a screen shot of the errors.

Hey John,

Which version of Unity are you using? Did you select WebGL Build Support as a component option when installing, or did you download and install the WebGL Build Support separately after the main Unity installation?

Out of interest, are you clicking Build or Build and Run?

Unity version 2018.2.8f1 windows 64bit

I loaded WebGL after initial loading of Unity

clicking Build and Run

Thanks for taking the time to try and help

I moved the project to my C: drive, created a new build folder on C:/dev/builds (outside the project), stopped my firewall and re-builtā€¦seems like it sort of helped, but the build dir is empty

1 Like

Hey John,

Ok, first test, just click Build instead of Build and Run.

Same result or something different?

Appears to be same result after just selecting BUILD onlyā€¦and build folder is emptyā€¦

hmmmā€¦ this error is proving to be quite troublesome and Iā€™ve been unable to reproduce it locally, as per the above thread.

I note you mentioned that you installed the WebGL Build Support separately, after the main Unity installation. I have seen other students experience build problems, admittedly different build problems, when this has been the case. In those situations, uninstalling the WebGL Build Support, and Unity, then reinstalling Unity and selecting the WebGL Build Support during the installation has resolved the problem.

Iā€™m happy to test your project at this end just to see if I can reproduce the same problem, if youā€™d be happy to share it?

The forum will allow uploads of up to 10MB, if your project files (zipped) are larger than that you would need to use a service such as Google Drive or Dropbox, and then share the URL.

Just another thought, which packages are installed in the new project? e.g;
image

here are my packagesā€¦I will try uninstalling Unity & WebGLā€¦then reinstall and selecting everything on the front end
packages

Before you do, presumably if you create an empty project and do not import the assets you can build successfully (for WebGL), like Harri above?

Also, if you goto Edit / Modulesā€¦, do the version numbers for the Playback Engines correspond with your version of Unity;

image

The above was taken from a Unity 2018.2.5 installation.

Did not see you message above until after reinstalling Unityā€¦that has been done insuring to have WebGL installed with the main programā€¦same exact resultsā€¦build folder is emptybuild_success3 modules

Your error has changedā€¦

What does the rest of it read, can you select it and then take another screenshot, the full error will appear in the pane below etc.

Sorry Robā€¦and thanks so much for trying to help figure this one outā€¦this is just doing the Build option, not the Build and Runā€¦

Thatā€™s a different error message to the one you showed above, where the error was talking about the WebGL Build Player?

Any chance you could zip up the project files and upload it here so I can grab a copy and take a look too?

hope this works:
https://drive.google.com/drive/folders/1txR8vOYO678XyQAjL3qWTMBeCDtzjPMA?usp=sharing

Having a look nowā€¦

Looks like you have a build within the project folder, did you set the working directory, e.g. where you project is as the build location?

Not sure, but I created a Windows download to try it on my PCā€¦could that be what that file is?

1 Like

Hi John,

Yes, it looks that way, I suspect it is.

I still havenā€™t been able to recreate the build issue at this end. Nothing stands out as strikingly obvious with the project settings, modules, imported packages etc.

I had hoped the inclusion of that build within the project folder, with it having the same name, would have been a clue, but it didnā€™t seem to make any difference.

Can you do a quick test when you get chance. Can you create a new, empty project, dont import any assets into it, and then try to build that as a WebGL build. Harri found that this worked, which is even more puzzling, but it would be interesting to see if your issues are seemingly identical.

After that I would probably start to look at other things so as;

  • working files location
  • build location
  • anti-virus

For the first two, Iā€™d probably go as simple as possible, so perhaps just have a C:\dev directory and a C:\build directory. Create the project in the Dev directory, build to the build directory. Root of C, separate directories etc.

Assuming that fails, I might also try the same thing but perhaps on the desktop, again two folders, keep it separate.

In both tests Iā€™d start new projects and import assets, as opposed to copying/pasting anything from a previous test.

On the anti-virus front, thatā€™s a bit of a stab in the dark, but often these products can cause all sorts of weird and wonderful issues, to rule it out perhaps you could disconnect from the internet, disable the anti-virus and then try the above again.

The only error online that comes anywhere near close to this is one talking about shadergraphs and buildpipelines and Iā€™m fairly confident that doesnā€™t apply in either yours or Harriā€™s cases. The change from using asm.js to WebAssembly is a recent change, but I have the same here and its fine, and Harri tried changing that for his builds and that made no difference.

If you have any other computers/laptops you could test this on it might be worth a look too.

Privacy & Terms