Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

could not build webgl even on an empty project. (2021.3.2f1 LTS)

Discussion in 'WebGL' started by utudiator, May 30, 2022.

  1. utudiator

    utudiator

    Joined:
    Feb 18, 2022
    Posts:
    4
    Could anyone help me fix this, I've tried to fix for more than a month now.
    The problem is , I have tried to build my project with WebGL but it always fail even on an empty project that I just created. The windows build has no problem though. If anyone could guide me the way to fix this, it would be very grateful for me.

    I think I've tried every methods I've found on internet such as uninstall unity + restart computer and reinstall unity or config the player setting.

    My unity version is 2021.3.2f1

    These are the errors log.


    Building Library\Bee\artifacts\WebGL\GameAssembly\master_WebGL_wasm\63zu_ystem.Core.o failed with output:
    C:\unityProj\20212f1test\Library\Bee\artifacts\WebGL\il2cppOutput\cpp\System.Core.cpp:32:1: error: unknown type name 'IL2CPP_EXTERN_C'
    IL2CPP_EXTERN_C RuntimeClass* ArgumentNullException_t327031E412FAB2351B0022DD5DAD47E67E597129_il2cpp_TypeInfo_var;
    ^
    C:\unityProj\20212f1test\Library\Bee\artifacts\WebGL\il2cppOutput\cpp\System.Core.cpp:32:29: error: expected ';' after top level declarator
    IL2CPP_EXTERN_C RuntimeClass* ArgumentNullException_t327031E412FAB2351B0022DD5DAD47E67E597129_il2cpp_TypeInfo_var;
    ^
    ;
    C:\unityProj\20212f1test\Library\Bee\artifacts\WebGL\il2cppOutput\cpp\System.Core.cpp:33:1: error: unknown type name 'IL2CPP_EXTERN_C'
    IL2CPP_EXTERN_C RuntimeClass* InvalidOperationException_t5DDE4D49B7405FAAB1E4576F4715A42A3FAD4BAB_il2cpp_TypeInfo_var;
    ^
    C:\unityProj\20212f1test\Library\Bee\artifacts\WebGL\il2cppOutput\cpp\System.Core.cpp:33:29: error: expected ';' after top level declarator
    IL2CPP_EXTERN_C RuntimeClass* InvalidOperationException_t5DDE4D49B7405FAAB1E4576F4715A42A3FAD4BAB_il2cpp_TypeInfo_var;
    ^
    ;
    C:\unityProj\20212f1test\Library\Bee\artifacts\WebGL\il2cppOutput\cpp\System.Core.cpp:34:1: error: unknown type name 'IL2CPP_EXTERN_C'
    IL2CPP_EXTERN_C String_t* _stringLiteral9D0E978C2541B8A36DFB07E397656689CE9E713F;
    ^
    C:\unityProj\20212f1test\Library\Bee\artifacts\WebGL\il2cppOutput\cpp\System.Core.cpp:34:25: error: expected ';' after top level declarator
    IL2CPP_EXTERN_C String_t* _stringLiteral9D0E978C2541B8A36DFB07E397656689CE9E713F;
    ^
    ;
    C:\unityProj\20212f1test\Library\Bee\artifacts\WebGL\il2cppOutput\cpp\System.Core.cpp:39:1: error: unknown type name 'IL2CPP_EXTERN_C_BEGIN'
    IL2CPP_EXTERN_C_BEGIN
    ^
    C:\unityProj\20212f1test\Library\Bee\artifacts\WebGL\il2cppOutput\cpp\System.Core.cpp:40:20: error: expected ';' after top level declarator
    IL2CPP_EXTERN_C_END
    ^
    ;
    C:\unityProj\20212f1test\Library\Bee\artifacts\WebGL\il2cppOutput\cpp\System.Core.cpp:55:71: error: expected class name
    struct Enumerable_t372195206D92B3F390693F9449282C31FD564C09 : public RuntimeObject
    ^
    C:\unityProj\20212f1test\Library\Bee\artifacts\WebGL\il2cppOutput\cpp\System.Core.cpp:60:66: error: expected class name
    struct Error_tCE0C9D928B2D2CC69DDEC1A0ECF05131938959DB : public RuntimeObject
    ^
    C:\unityProj\20212f1test\Library\Bee\artifacts\WebGL\il2cppOutput\cpp\System.Core.cpp:65:27: error: expected class name
    struct String_t : public RuntimeObject
    ^
    C:\unityProj\20212f1test\Library\Bee\artifacts\WebGL\il2cppOutput\cpp\System.Core.cpp:70:2: error: unknown type name 'Il2CppChar'
    Il2CppChar ____firstChar_5;
    ^
    C:\unityProj\20212f1test\Library\Bee\artifacts\WebGL\il2cppOutput\cpp\System.Core.cpp:80:70: error: expected class name
    struct ValueType_t6D9B272BD21782F0A9A14F2E41F85A50E97A986F : public RuntimeObject
    ^
    C:\unityProj\20212f1test\Library\Bee\artifacts\WebGL\il2cppOutput\cpp\System.Core.cpp:118:30: error: expected class name
    struct Exception_t : public RuntimeObject
    ^
    C:\unityProj\20212f1test\Library\Bee\artifacts\WebGL\il2cppOutput\cpp\System.Core.cpp:125:2: error: unknown type name 'RuntimeObject'
    RuntimeObject* ____data_3;
    ^
    C:\unityProj\20212f1test\Library\Bee\artifacts\WebGL\il2cppOutput\cpp\System.Core.cpp:131:2: error: unknown type name 'RuntimeObject'
    RuntimeObject* ____stackTrace_6;
    ^
    C:\unityProj\20212f1test\Library\Bee\artifacts\WebGL\il2cppOutput\cpp\System.Core.cpp:139:2: error: unknown type name 'RuntimeObject'
    RuntimeObject* ____dynamicMethods_10;
    ^
    C:\unityProj\20212f1test\Library\Bee\artifacts\WebGL\il2cppOutput\cpp\System.Core.cpp:157:2: error: unknown type name 'RuntimeObject'
    RuntimeObject* ___s_EDILock_0;
    ^
    C:\unityProj\20212f1test\Library\Bee\artifacts\WebGL\il2cppOutput\cpp\System.Core.cpp:164:2: error: unknown type name 'RuntimeObject'
    RuntimeObject* ____data_3;
    ^
    fatal error: too many errors emitted, stopping now [-ferror-limit=]
    20 errors generated.
    emcc2: error: '"C:/Program Files/Unity 2021.3.2f1/Editor/Data/PlaybackEngines/WebGLSupport/BuildTools/Emscripten/llvm\clang++.exe" -target wasm32-unknown-emscripten -DEMSCRIPTEN -fno-inline-functions -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-cxx-exceptions -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr -D__EMSCRIPTEN_major__=2 -D__EMSCRIPTEN_minor__=0 -D__EMSCRIPTEN_tiny__=19 -D_LIBCPP_ABI_VERSION=2 -Dunix -D__unix -D__unix__ -Werror=implicit-function-declaration -Xclang -iwithsysroot/include/SDL "--sysroot=C:\Program Files\Unity 2021.3.2f1\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten\emscripten\cache\sysroot" -Xclang -iwithsysroot/include\compat -D__webgl__ -Wno-c++11-extensions -Wno-nonportable-include-path -ffunction-sections -fno-unwind-tables -fomit-frame-pointer -fno-threadsafe-statics -std=c++11 -Wno-#warnings -Wswitch -Wno-trigraphs -Wno-tautological-compare -Wno-invalid-offsetof -Wno-implicitly-unsigned-literal -Wno-integer-overflow -Wno-shift-negative-value -Wno-unknown-attributes -Wno-implicit-function-declaration -Wno-null-conversion -Wno-missing-declarations -Wno-unused-value -Wno-pragma-once-outside-header -fvisibility=hidden -fexceptions -fno-rtti -fno-strict-overflow -ffunction-sections -fdata-sections -fmessage-length=0 -pipe -DBASELIB_INLINE_NAMESPACE=il2cpp_baselib -DIL2CPP_MONO_DEBUGGER_DISABLED -DRUNTIME_IL2CPP -DHAVE_BDWGC_GC -DNDEBUG -I. -IC:/unityProj/20212f1test/Library/Bee/artifacts/WebGL/il2cppOutput/cpp "-IC:/Program Files/Unity 2021.3.2f1/Editor/Data/il2cpp/libil2cpp/pch" "-IC:/Program Files/Unity 2021.3.2f1/Editor/Data/il2cpp/libil2cpp" "-IC:/Program Files/Unity 2021.3.2f1/Editor/Data/il2cpp/external/baselib/Include" "-IC:/Program Files/Unity 2021.3.2f1/Editor/Data/il2cpp/external/baselib/Platforms/WebGL/Include" -Oz -fcolor-diagnostics -fdiagnostics-absolute-paths -UGC_THREADS -UUSE_MMAP -UUSE_MUNMAP -c -xc++ C:/unityProj/20212f1test/Library/Bee/artifacts/WebGL/il2cppOutput/cpp/System.Core.cpp -o Library/Bee/artifacts/WebGL/GameAssembly/master_WebGL_wasm/63zu_ystem.Core.o' failed (1)
    UnityEngine.GUIUtility:processEvent (int,intptr,bool&)
     
  2. MadeFromPolygons

    MadeFromPolygons

    Joined:
    Oct 5, 2013
    Posts:
    3,885
    Also have issues, since updating to 2021 all builds fail with Library/Bee/artifacts errors
     
  3. adamgolden

    adamgolden

    Joined:
    Jun 17, 2019
    Posts:
    1,505
    Deleting the Library/Bee and Library/BuildCache folders before doing the build has worked for me to solve this with a number of engine versions. It has also been suggested that doing a "Clean Build" is equivalent to doing that, though I haven't confirmed. There have also been versions of the engine that the only way to get a build to complete (though in my case for 64-bit Windows 10 standalone, not WebGL) was to create a new user account (in Windows) which does NOT have Administrator privileges and install the editors on that, and do builds while logged in with that account.
     
  4. utudiator

    utudiator

    Joined:
    Feb 18, 2022
    Posts:
    4

    Thanks, I have tried to reinstall the windows with without deleting user files, it didn't work so I just use the unity 2020 version for couple months. Then today I tried to reinstall the windows again (windows 10) but without saving the user folder. This time it works! no more webgl error when build
     
  5. utudiator

    utudiator

    Joined:
    Feb 18, 2022
    Posts:
    4
    Thanks to polemical , I have tried to reinstall the windows with without deleting user files, it didn't work so I just use the unity 2020 version for couple months. Then today I tried to reinstall the windows again (windows 10) but without saving the user folder. This time it works! no more webgl error when build
     
  6. utudiator

    utudiator

    Joined:
    Feb 18, 2022
    Posts:
    4
    So my solution was reset windows without using the old user files (clean window re-install). Then the error when building webgl even in a blank project just gone!

     
    adamgolden likes this.