- Home /
WebGL development build error
version 2019.3.0a5
I can build my project normally but not in development mode
Failed running C:\Program Files\Unity\Hub\Editor\2019.3.0a5\Editor\Data\il2cpp/build/il2cpp.exe --convert-to-cpp --emit-null-checks --enable-stacktrace --enable-array-bounds-check --dotnetprofile="unityaot" --compile-cpp --libil2cpp-static --platform="WebGL" --architecture="EmscriptenJavaScript" --configuration="Release" --outputpath="MYPATH\Assets /../Temp/StagingArea/Data\Native\build.bc" --cachedirectory="MYPATH\Assets\..\Library/il2cpp_cache" --compiler-flags="-Oz" --emit-method-map --additional-libraries="C:/Program Files/Unity/Hub/Editor/2019.3.0a5/Editor/Data/PlaybackEngines/WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_AccessibilityModule_Dynamic.bc" --additional-libraries="C:/Program Files/Unity/Hub/Editor/2019.3.0a5/Editor/Data/PlaybackEngines/WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_AIModule_Dynamic.bc" --additional-libraries="C:/Program Files/Unity/Hub/Editor/2019.3.0a5/Editor/Data/PlaybackEngines/WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_AndroidJNIModule_Dynamic.bc" --additional-libraries="C:/Program Files/Unity/Hub/Editor/2019.3.0a5/Editor/Data/PlaybackEngines/WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_AnimationModule_Dynamic.bc" --additional-libraries="C:/Program Files/Unity/Hub/Editor/2019.3.0a5/Editor/Data/PlaybackEngines/WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_ARModule_Dynamic.bc" --additional-libraries="C:/Program Files/Unity/Hub/Editor/2019.3.0a5/Editor/Data/PlaybackEngines/WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_AssetBundleModule_Dynamic.bc" --additional-libraries="C:/Program Files/Unity/Hub/Editor/2019.3.0a5/Editor/Data/PlaybackEngines/WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_AudioModule_Dynamic.bc" --additional-libraries="C:/Program Files/Unity/Hub/Editor/2019.3.0a5/Editor/Data/PlaybackEngines/WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_ClothModule_Dynamic.bc" --additional-libraries="C:/Program Files/Unity/Hub/Editor/2019.3.0a5/Editor/Data/PlaybackEngines/WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_CoreModule_Dynamic.bc" --additional-libraries="C:/Program Files/Unity/Hub/Editor/2019.3.0a5/Editor/Data/PlaybackEngines/WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_CrashReportingModule_Dynamic.bc" --additional-libraries="C:/Program Files/Unity/Hub/Editor/2019.3.0a5/Editor/Data/PlaybackEngines/WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_DirectorModule_Dynamic.bc" --additional-libraries="C:/Program Files/Unity/Hub/Editor/2019.3.0a5/Editor/Data/PlaybackEngines/WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_DSPGraphModule_Dynamic.bc" --additional-libraries="C:/Program Files/Unity/Hub/Editor/2019.3.0a5/Editor/Data/PlaybackEngines/WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_GameCenterModule_Dynamic.bc" --additional-libraries="C:/Program Files/Unity/Hub/Editor/2019.3.0a5/Editor/Data/PlaybackEngines/WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_GridModule_Dynamic.bc" --additional-libraries="C:/Program Files/Unity/Hub/Editor/2019.3.0a5/Editor/Data/PlaybackEngines/WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_HotReloadModule_Dynamic.bc" --additional-libraries="C:/Program Files/Unity/Hub/Editor/2019.3.0a5/Editor/Data/PlaybackEngines/WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_ImageConversionModule_Dynamic.bc" --additional-libraries="C:/Program Files/Unity/Hub/Editor/2019.3.0a5/Editor/Data/PlaybackEngines/WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_IMGUIModule_Dynamic.bc" --additional-libraries="C:/Program Files/Unity/Hub/Editor/2019.3.0a5/Editor/Data/PlaybackEngines/WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_InputLegacyModule_Dynamic.bc" --additional-libraries="C:/Program Files/Unity/Hub/Editor/2019.3.0a5/Editor/Data/PlaybackEngines/WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_InputModule_Dynamic.bc" --additional-libraries="C:/Program Files/Unity/Hub/Editor/2019.3.0a5/Editor/Data/PlaybackEngines/WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_JSONSerializeModule_Dynamic.bc" --additional-libraries="C:/Program Files/Unity/Hub/Editor/2019.3.0a5/Editor/Data/PlaybackEngines/WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_LocalizationModule_Dynamic.bc" --additional-libraries="C:/Program Files/Unity/Hub/Editor/2019.3.0a5/Editor/Data/PlaybackEngines/WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_ParticleSystemModule_Dynamic.bc" --additional-libraries="C:/Program Files/Unity/Hub/Editor/2019.3.0a5/Editor/Data/PlaybackEngines/WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_PerformanceReportingModule_Dynamic.bc" --additional-libraries="C:/Program Files/Unity/Hub/Editor/2019.3.0a5/Editor/Data/PlaybackEngines/WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_Physics2DModule_Dynamic.bc" --additional-libraries="C:/Program Files/Unity/Hub/Editor/2019.3.0a5/Editor/Data/PlaybackEngines/WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_PhysicsModule_Dynamic.bc" --additional-libraries="C:/Program Files/Unity/Hub/Editor/2019.3.0a5/Editor/Data/PlaybackEngines/WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_ProfilerModule_Dynamic.bc" --additional-libraries="C:/Program Files/Unity/Hub/Editor/2019.3.0a5/Editor/Data/PlaybackEngines/WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_ScreenCaptureModule_Dynamic.bc" --additional-libraries="C:/Program Files/Unity/Hub/Editor/2019.3.0a5/Editor/Data/PlaybackEngines/WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_SharedInternalsModule_Dynamic.bc" --additional-libraries="C:/Program Files/Unity/Hub/Editor/2019.3.0a5/Editor/Data/PlaybackEngines/WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_SpriteMaskModule_Dynamic.bc" --additional-libraries="C:/Program Files/Unity/Hub/Editor/2019.3.0a5/Editor/Data/PlaybackEngines/WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_SpriteShapeModule_Dynamic.bc" --additional-libraries="C:/Program Files/Unity/Hub/Editor/2019.3.0a5/Editor/Data/PlaybackEngines/WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_StreamingModule_Dynamic.bc" --additional-libraries="C:/Program Files/Unity/Hub/Editor/2019.3.0a5/Editor/Data/PlaybackEngines/WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_SubstanceModule_Dynamic.bc" --additional-libraries="C:/Program Files/Unity/Hub/Editor/2019.3.0a5/Editor/Data/PlaybackEngines/WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_TerrainModule_Dynamic.bc" --additional-libraries="C:/Program Files/Unity/Hub/Editor/2019.3.0a5/Editor/Data/PlaybackEngines/WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_TerrainPhysicsModule_Dynamic.bc" --additional-libraries="C:/Program Files/Unity/Hub/Editor/2019.3.0a5/Editor/Data/PlaybackEngines/WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_TextCoreModule_Dynamic.bc" --additional-libraries="C:/Program Files/Unity/Hub/Editor/2019.3.0a5/Editor/Data/PlaybackEngines/WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_TextRenderingModule_Dynamic.bc" --additional-libraries="C:/Program Files/Unity/Hub/Editor/2019.3.0a5/Editor/Data/PlaybackEngines/WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_TilemapModule_Dynamic.bc" --additional-libraries="C:/Program Files/Unity/Hub/Editor/2019.3.0a5/Editor/Data/PlaybackEngines/WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_TLSModule_Dynamic.bc" --additional-libraries="C:/Program Files/Unity/Hub/Editor/2019.3.0a5/Editor/Data/PlaybackEngines/WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_UIElementsModule_Dynamic.bc" --additional-libraries="C:/Program Files/Unity/Hub/Editor/2019.3.0a5/Editor/Data/PlaybackEngines/WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_UIModule_Dynamic.bc" --additional-libraries="C:/Program Files/Unity/Hub/Editor/2019.3.0a5/Editor/Data/PlaybackEngines/WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_UmbraModule_Dynamic.bc" --additional-libraries="C:/Program Files/Unity/Hub/Editor/2019.3.0a5/Editor/Data/PlaybackEngines/WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_UNETModule_Dynamic.bc" --additional-libraries="C:/Program Files/Unity/Hub/Editor/2019.3.0a5/Editor/Data/PlaybackEngines/WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_UnityAnalyticsModule_Dynamic.bc" --additional-libraries="C:/Program Files/Unity/Hub/Editor/2019.3.0a5/Editor/Data/PlaybackEngines/WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_UnityConnectModule_Dynamic.bc" --additional-libraries="C:/Program Files/Unity/Hub/Editor/2019.3.0a5/Editor/Data/PlaybackEngines/WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_UnityTestProtocolModule_Dynamic.bc" --additional-libraries="C:/Program Files/Unity/Hub/Editor/2019.3.0a5/Editor/Data/PlaybackEngines/WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_UnityWebRequestAssetBundleModule_Dynamic.bc" --additional-libraries="C:/Program Files/Unity/Hub/Editor/2019.3.0a5/Editor/Data/PlaybackEngines/WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_UnityWebRequestAudioModule_Dynamic.bc" --additional-libraries="C:/Program Files/Unity/Hub/Editor/2019.3.0a5/Editor/Data/PlaybackEngines/WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_UnityWebRequestModule_Dynamic.bc" --additional-libraries="C:/Program Files/Unity/Hub/Editor/2019.3.0a5/Editor/Data/PlaybackEngines/WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_UnityWebRequestTextureModule_Dynamic.bc" --additional-libraries="C:/Program Files/Unity/Hub/Editor/2019.3.0a5/Editor/Data/PlaybackEngines/WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_UnityWebRequestWWWModule_Dynamic.bc" --additional-libraries="C:/Program Files/Unity/Hub/Editor/2019.3.0a5/Editor/Data/PlaybackEngines/WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_VehiclesModule_Dynamic.bc" --additional-libraries="C:/Program Files/Unity/Hub/Editor/2019.3.0a5/Editor/Data/PlaybackEngines/WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_VFXModule_Dynamic.bc" --additional-libraries="C:/Program Files/Unity/Hub/Editor/2019.3.0a5/Editor/Data/PlaybackEngines/WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_VideoModule_Dynamic.bc" --additional-libraries="C:/Program Files/Unity/Hub/Editor/2019.3.0a5/Editor/Data/PlaybackEngines/WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_VRModule_Dynamic.bc" --additional-libraries="C:/Program Files/Unity/Hub/Editor/2019.3.0a5/Editor/Data/PlaybackEngines/WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_WebGLModule_Dynamic.bc" --additional-libraries="C:/Program Files/Unity/Hub/Editor/2019.3.0a5/Editor/Data/PlaybackEngines/WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_WindModule_Dynamic.bc" --additional-libraries="C:/Program Files/Unity/Hub/Editor/2019.3.0a5/Editor/Data/PlaybackEngines/WebGLSupport\BuildTools\lib\modules_development\WebGLSupport_XRModule_Dynamic.bc" --enable-debugger --profiler-report --map-file-parser="C:/Program Files/Unity/Hub/Editor/2019.3.0a5/Editor/Data/Tools/MapFileParser/MapFileParser.exe" --directory="C:/Users/giuseppei/OneDrive - Agic Technology srl/Documenti/Unity/MyGPViewer4.0/Temp/StagingArea/Data/Managed" --generatedcppdir="C:/Users/giuseppei/OneDrive - Agic Technology srl/Documenti/Unity/MyGPViewer4.0/Temp/StagingArea/Data/il2cppOutput"
stdout:
Building build.bc with EmscriptenToolChain
Output directory: MYPATH\Temp\StagingArea\Data\Native
Cache directory: MYPATH\Library\il2cpp_cache
il2cpp.exe didn't catch exception: Unity.IL2CPP.Building.BuilderFailedException: In file included from MYPATH\Temp\StagingArea\Data\il2cppOutput\lumpedcpp\Lump_libil2cpp_os.cpp:7:
MYPATH\Temp\StagingArea\Data\il2cppOutput\lumpedcpp/..\..\..\..\..\..\..\..\..\..\..\Program Files\Unity\Hub\Editor\2019.3.0a5\Editor\Data\il2cpp\libil2cpp\os\Emscripten\SocketBridge.cpp:8:10: fatal error: 'emscripten/posix_socket.h' file not found
#include <emscripten/posix_socket.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
ERROR:root:compiler frontend failed to generate LLVM bitcode, halting
Invocation was: Executable: "C:\Program Files\Unity\Hub\Editor\2019.3.0a5\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten_Win\python\2.7.5.3_64bit\python.exe"
Arguments: -E "C:\Program Files\Unity\Hub\Editor\2019.3.0a5\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten\em++" -Wno-unused-value -Wno-invalid-offsetof -nostdinc -fno-strict-overflow -Wno-null-conversion -std=c++11 -s USE_PTHREADS=1 -O3 -Oz -DNET_4_0 -DUNITY_AOT -DIL2CPP_MONO_DEBUGGER=1 -DIL2CPP_DEBUGGER_PORT=56000 -DPLATFORM_UNITY -DUNITY_USE_PLATFORM_STUBS -DENABLE_OVERRIDABLE_ALLOCATORS -DIL2CPP_ON_MONO=1 -DDISABLE_JIT=1 -DDISABLE_REMOTING=1 -DHAVE_CONFIG_H -DMONO_DLL_EXPORT=1 -DGC_NOT_DLL -DRUNTIME_IL2CPP -DNDEBUG -I"C:\Program Files\Unity\Hub\Editor\2019.3.0a5\Editor\Data\il2cpp\libil2cpp" -I"C:\Program Files\Unity\Hub\Editor\2019.3.0a5\Editor\Data\il2cpp\libil2cpp" -I"C:\Program Files\Unity\Hub\Editor\2019.3.0a5\Editor\Data\il2cpp\external\bdwgc\include" -I"C:\Program Files\Unity\Hub\Editor\2019.3.0a5\Editor\Data\il2cpp\external\xxHash" -I"C:\Program Files\Unity\Hub\Editor\2019.3.0a5\Editor\Data\il2cpp\external\mono" -I"C:\Program Files\Unity\Hub\Editor\2019.3.0a5\Editor\Data\il2cpp\external\mono\mono\eglib" -I"C:\Program Files\Unity\Hub\Editor\2019.3.0a5\Editor\Data\il2cpp\external\mono\mono" -I"C:\Program Files\Unity\Hub\Editor\2019.3.0a5\Editor\Data\il2cpp\external\mono\mono\sgen" -I"C:\Program Files\Unity\Hub\Editor\2019.3.0a5\Editor\Data\il2cpp\external\mono\mono\utils" -I"C:\Program Files\Unity\Hub\Editor\2019.3.0a5\Editor\Data\il2cpp\external\mono\mono\metadata" -I"C:\Program Files\Unity\Hub\Editor\2019.3.0a5\Editor\Data\il2cpp\external\mono\mono\metadata\private" -I"C:\Program Files\Unity\Hub\Editor\2019.3.0a5\Editor\Data\il2cpp\libil2cpp\os\c-api" -I"C:\Program Files\Unity\Hub\Editor\2019.3.0a5\Editor\Data\il2cpp\libmono\config" "MYPATH\Temp\StagingArea\Data\il2cppOutput\lumpedcpp\Lump_libil2cpp_os.cpp" -o "MYPATH\Library\il2cpp_cache\libil2cpp\B9B59419A7EA6753C312FB9A0E581DC3.o"
in Unity.IL2CPP.Building.CppProgramBuilder.BuildAllCppFiles(IEnumerable`1 sourceFilesToCompile, IBuildStatisticsCollector statisticsCollector)
in Unity.IL2CPP.Building.CppProgramBuilder.Build(IBuildStatistics& statistics)
in il2cpp.Program.DoRun(String[] args)
in il2cpp.Program.Run(String[] args)
in il2cpp.Program.Main(String[] args)
stderr:
Eccezione non gestita: Unity.IL2CPP.Building.BuilderFailedException: In file included from MYPATH\Temp\StagingArea\Data\il2cppOutput\lumpedcpp\Lump_libil2cpp_os.cpp:7:
MYPATH\Temp\StagingArea\Data\il2cppOutput\lumpedcpp/..\..\..\..\..\..\..\..\..\..\..\Program Files\Unity\Hub\Editor\2019.3.0a5\Editor\Data\il2cpp\libil2cpp\os\Emscripten\SocketBridge.cpp:8:10: fatal error: 'emscripten/posix_socket.h' file not found
#include <emscripten/posix_socket.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
ERROR:root:compiler frontend failed to generate LLVM bitcode, halting
I found the root cause (old version of emscripten distributed with Unity), and submitted a bug report, you can follow this thread: https://forum.unity.com/threads/cannot-build-in-development-mode.691183/#post-5986559
A possible fix would be to build a more recent version of emscripten and put it in your BuildTools/Emscripten folder, but I don't guarantee anything. Also, it would only work on your PC.
Answer by bender_23 · Jun 14, 2019 at 12:34 PM
@trumanita I have the very same problem:
...\UNITY\Editors\2019.3.0a2\Editor\Data\il2cpp\libil2cpp\os\Emscripten\SocketBridge.cpp:8:10: fatal error: 'emscripten/posix_socket.h' file not found
To be sure I checked that there really is no 'posix_socket.h' in the unity install path.
This only happens when I attempt a development build. For deployment the build is successful.
It helped me to remove temp folder and library folder from the project, start Unity and build again
You're adding details here (which was helpful, it helped me find the cause of the bug), so it should rather be a comment; unless your answer is "this happens because there is no posix_socket.h in the Unity install and there's nothing we can do about it". @trumanita on your side, you shouldn't mark it as answer unless you interpret it as such (but again, it would need reformatting to emphasize you're explaining the cause and saying there's no easy solution).
Answer by DrViJ · Aug 15, 2019 at 09:34 PM
Hello, I had the same problem today (fatal error: 'emscripten/posix_socket.h' file not found), Unity 2019.2.0f. It helped me to clear Library and temp folder of the project, start unity and build again. the build succeed
Answer by mainVar · Jun 12, 2019 at 09:22 AM
Check your code Usually the problem is purely in the program code. but there may also be problems due to the use of third-party plug-ins. Also check to see if the game uses an internet connection to write files, browsers don't like when games download something.
I also recommend do not update project (you can have problems with) UnityEditor.BuildPlayerWindow + BuildMethodException
I don't understand very well this answer. I have this error when I build the project checking "development mode". It builds fine when I uncheck that. I think I can exclude that problem is related with my code. I can think it could be related with some 3rd party plugin I don't understand why you're talking about browsers Thanks in advance, bye
Such an error will not occur if the game is made for offline mode and does not interact with the network. But if you use a network, then it’s not so simple, because if I’m not mistaken, the usual option for communicating with the network doesn’t work there (I need an intermediate server there). But I can be wrong and now something has changed. In general, if the game does not require a network, then try to look for a code that works with the network, perhaps the reason is in it.
Your answer
Follow this Question
Related Questions
WebGL game not working at all! 1 Answer
Webgl build - only 64 bit editor??? 1 Answer
Blob error in WebGL 0 Answers
WebGL won't build 0 Answers
RenderTexture.Create failed RenderTexture.GenerateMips failed 1 Answer