OpenDL, Unable to open DLL

I get this error that DLLs are not supported in WebGL. But It doesn’t tell me which DLL! How should I go on with this?? I am porting an already existing project so There are a lot of packages and I couldn’t figure out which is which, (for sqlite it gave me a specific error but after that I can’t figure out what is the problem!)

Are you using any libraries that call into native code? I believe that all managed c-sharp stuff should get compiled down to web assembly, but if you are loading a full at runtime, say launching a managed library that won’t work even though it will on desktop and a good chunk of mobile platforms

I really don’t know. there are lots of libraries, my guess is Rest Sharp, I don’t know why but the project is using rest sharp instead of unity web request!
how can I figure out which libraries are calling into the native code?

Usually when something is calling into native code it’s going to be via a wrapper to integrate a non C# library into c#. I don’t imagine unity would cut off the majority of the asset store so I imagine they probably have a way to include specified managed dlls into the building process and convert them to web assembly, but maybe they don’t.

Can you copy paste the full error message?

1 Like

I think a good way of identifying which package uses native libraries is to search for a “Plugins” directory in the the packages folder(for example using the search of Windows Explorer/Finder or a command line tool). If this folder contains files with the extension .dll, .so or .dylib it is a native plugin that uses dynamic linking. Another way is to search for the [DllImport (“PluginName”)] attribute inside C# scripts. Refer to https://docs.unity3d.com/Manual/NativePlugins.html for more information. I would then try to remove the relevant package from the project if possible and repeat this process until all packages with dynamically linked native plugins are removed.

It is possible to use native plugins for the Web player but they either need to be added as source code or compiled to WebAssembly with emscripten as a static library by the author of the package. Sadly, there is no straight-forward way to convert an existing dynamic library to WebAssembly. The library might call into OS-specific APIs which aren’t available on the web. So in most cases it would require changes to the codebase of the plugin to make them compatible.

1 Like

I get this error when I want to register a user in the game, which uses the network component which uses the rest sharp instead of unity web request so is my guess. here is the full log, thank you

printErr http://localhost:63343/20pwa dev/Build/20pwa dev.loader.js:81
    warnOnce http://localhost:63343/20pwa dev/Build/20pwa dev.framework.js:1478
    _dlopen http://localhost:63343/20pwa dev/Build/20pwa dev.framework.js:9895
    il2cpp_baselib::Baselib_DynamicLibrary_OpenUtf8(char const*, il2cpp_baselib::Baselib_ErrorState*) http://localhost:63343/20pwa dev/Build/20pwa dev.wasm:1026856
    il2cpp::os::LibraryLoader::TryOpeningLibrary(char const*, std::__2::basic_string<char, std::__2::char_traits<char>, std::__2::allocator<char>>&) http://localhost:63343/20pwa dev/Build/20pwa dev.wasm:1072516
    il2cpp::os::LibraryLoader::ProbeForLibrary(char const*, unsigned long, std::__2::basic_string<char, std::__2::char_traits<char>, std::__2::allocator<char>>&) http://localhost:63343/20pwa dev/Build/20pwa dev.wasm:1078371
    il2cpp::os::LibraryLoader::LoadDynamicLibrary(il2cpp::utils::StringView<char>, std::__2::basic_string<char, std::__2::char_traits<char>, std::__2::allocator<char>>&) http://localhost:63343/20pwa dev/Build/20pwa dev.wasm:1069843
    dynCall_iii http://localhost:63343/20pwa dev/Build/20pwa dev.wasm:53826976
    unityFramework http://localhost:63343/20pwa dev/Build/20pwa dev.framework.js:898
    invoke_iii http://localhost:63343/20pwa dev/Build/20pwa dev.framework.js:18655
    il2cpp::vm::PlatformInvoke::Resolve(PInvokeArguments const&) http://localhost:63343/20pwa dev/Build/20pwa dev.wasm:1146875
    il2cpp_codegen_resolve(PInvokeArguments const&) http://localhost:63343/20pwa dev/Build/20pwa dev.wasm:1448886
    dynCall_ii http://localhost:63343/20pwa dev/Build/20pwa dev.wasm:53826847
    unityFramework http://localhost:63343/20pwa dev/Build/20pwa dev.framework.js:898
    invoke_ii http://localhost:63343/20pwa dev/Build/20pwa dev.framework.js:18600
    CommonUnixIPGlobalProperties_get_DomainName_mB1A7E8779FEC53B9173DD83534EC1848B61D6CD3 http://localhost:63343/20pwa dev/Build/20pwa dev.wasm:11916926
    CookieContainer__ctor_mDFB99605E29E20FC8F2379AB3F4F56FA9B67834F http://localhost:63343/20pwa dev/Build/20pwa dev.wasm:11726725
    U3CU3Ec__DisplayClass183_0_U3CConfigureWebRequestU3Eg__AppendCookiesU7C2_mBB57A438B43CBDE30F5FDB4696A039A24FE0EE2C http://localhost:63343/20pwa dev/Build/20pwa dev.wasm:19987267
    Http_ConfigureWebRequest_mB5374C6C708B0863B5E2C8DD2C100C0F142A19AD http://localhost:63343/20pwa dev/Build/20pwa dev.wasm:19984621
    Http_ConfigureAsyncWebRequest_m0F4D48016217FE6F71EB99B434F882C699CC1495 http://localhost:63343/20pwa dev/Build/20pwa dev.wasm:19989306
    dynCall_iiiii http://localhost:63343/20pwa dev/Build/20pwa dev.wasm:53826964
    unityFramework http://localhost:63343/20pwa dev/Build/20pwa dev.framework.js:898
    invoke_iiiii http://localhost:63343/20pwa dev/Build/20pwa dev.framework.js:18699
    Http_PutPostInternalAsync_m7E196984B94D338C0EEC4FA1F130202DD6593DEE http://localhost:63343/20pwa dev/Build/20pwa dev.wasm:19959599
    Http_AsPostAsync_mAE80CDAAE21918792A79ADE71AB2086E407DF9A4 http://localhost:63343/20pwa dev/Build/20pwa dev.wasm:19959531
    RestClient_DoAsPostAsync_m64B35414BCAAFC7A6EFDB0E2EF3BD37E960D2BE2 http://localhost:63343/20pwa dev/Build/20pwa dev.wasm:19996121
    Func_4_Invoke_m9BAD5BBD30933FE9049B012CD3316FB2F24F3B8A_OpenStatic(Func_4_t5BEC908E1F7894319A22CA9728A897FA95522DAD*, Il2CppObject*, Il2CppObject*, Il2CppObject*, MethodInfo const*) http://localhost:63343/20pwa dev/Build/20pwa dev.wasm:9513179
    RestClient_ExecuteAsync_mBA3D00AC4394A5FE4B5C6187E225638157410FFE http://localhost:63343/20pwa dev/Build/20pwa dev.wasm:19997451
    RestClient_ExecuteAsync_m5CD78EC41C0CD8338CEFFBE0D6C9A3FEBC53F806 http://localhost:63343/20pwa dev/Build/20pwa dev.wasm:19996384
    RestClient_ExecuteAsync_m8141C1AB9CE3D678A583DB13DC4ACE2DB8C5A6BC http://localhost:63343/20pwa dev/Build/20pwa dev.wasm:20006789
    dynCall_iiiii http://localhost:63343/20pwa dev/Build/20pwa dev.wasm:53826964
    unityFramework http://localhost:63343/20pwa dev/Build/20pwa dev.framework.js:898
    invoke_iiiii http://localhost:63343/20pwa dev/Build/20pwa dev.framework.js:18699
    RestClient_ExecuteAsync_mD1E325E33BA3F3BED03035A824CFE6160BB4635B http://localhost:63343/20pwa dev/Build/20pwa dev.wasm:20007294
    dynCall_iiiii http://localhost:63343/20pwa dev/Build/20pwa dev.wasm:53826964
    unityFramework http://localhost:63343/20pwa dev/Build/20pwa dev.framework.js:898
    invoke_iiiii http://localhost:63343/20pwa dev/Build/20pwa dev.framework.js:18699
    U3CPostU3Ed__24_MoveNext_m110ED0297A3D982EDE81CC97CC101D483F51CD17 http://localhost:63343/20pwa dev/Build/20pwa dev.wasm:21379342
    dynCall_vii http://localhost:63343/20pwa dev/Build/20pwa dev.wasm:53826908
    unityFramework http://localhost:63343/20pwa dev/Build/20pwa dev.framework.js:898
    invoke_vii http://localhost:63343/20pwa dev/Build/20pwa dev.framework.js:18622
    AsyncVoidMethodBuilder_Start_TisRuntimeObject_m3CA145CBB6CFE8B4ADD6148BF98E85899F95DCEA_gshared http://localhost:63343/20pwa dev/Build/20pwa dev.wasm:24240655
    Network_Post_mCCB9124AEEB152AC0018F2659C63569F5F5D573F http://localhost:63343/20pwa dev/Build/20pwa dev.wasm:22296219
    NetworkFallbackService_Execute_m769E63EFE3D09E2895342021EE76755044DA2BCA http://localhost:63343/20pwa dev/Build/20pwa dev.wasm:21382598
    Network_BaseRequest_mD39FAFCE68879D6CA47DCC2590267BE3CDB239A4 http://localhost:63343/20pwa dev/Build/20pwa dev.wasm:22293150
    MemberShip_FastRegister_m7191400567B04EEBC3DC3A38B0BB136CECFE7259 http://localhost:63343/20pwa dev/Build/20pwa dev.wasm:21459949
    RegisterLoginScript_FastRegister_m682FE3B0FF4B7AD3582677008DBEF123019B756D http://localhost:63343/20pwa dev/Build/20pwa dev.wasm:21083064
    UnityEvent_Invoke_mFBF80D59B03C30C5FE6A06F897D954ACADE061D2 http://localhost:63343/20pwa dev/Build/20pwa dev.wasm:33131265
    Button_OnPointerClick_mB76B80D7374811C7BBE11DA188E2656904AE5422 http://localhost:63343/20pwa dev/Build/20pwa dev.wasm:8173947
    ExecuteEvents_Execute_m512ACDD06180A73819570FED3C2BEE0F0E2DA3F2 http://localhost:63343/20pwa dev/Build/20pwa dev.wasm:8452452
    EventFunction_1_Invoke_m98A8A653E7180305E41F7CFFDDD9D32C63B96FE7_OpenStatic(EventFunction_1_t297B5C47242D1B98BEC955E2804FA142B43E7927*, Il2CppObject*, BaseEventData_tE03A848325C0AE8E76C6CA15FD86395EBF83364F*, MethodInfo const*) http://localhost:63343/20pwa dev/Build/20pwa dev.wasm:25050663
    dynCall_viiii http://localhost:63343/20pwa dev/Build/20pwa dev.wasm:53826934
    unityFramework http://localhost:63343/20pwa dev/Build/20pwa dev.framework.js:898
    invoke_viiii http://localhost:63343/20pwa dev/Build/20pwa dev.framework.js:18644
    ExecuteEvents_Execute_TisRuntimeObject_mDC4455B743BE4A6BA46DD741D0E0AB150FF1209A_gshared http://localhost:63343/20pwa dev/Build/20pwa dev.wasm:19323782
    StandaloneInputModule_ReleaseMouse_mC5C3083C356ACD5CD420A58662D99A6CACC5FAF5 http://localhost:63343/20pwa dev/Build/20pwa dev.wasm:8470458
    StandaloneInputModule_ProcessMousePress_m24665E707FEF5C80719847D62A8A8AEABE27C6C5 http://localhost:63343/20pwa dev/Build/20pwa dev.wasm:8477758
    StandaloneInputModule_ProcessMouseEvent_m8A8214EB9286BA31C18F515BCC3349DF740B2BBA http://localhost:63343/20pwa dev/Build/20pwa dev.wasm:8472922
    StandaloneInputModule_Process_mBD949CC45BBCAB5A0FAF5E24F3BB4C3B22FF3E81 http://localhost:63343/20pwa dev/Build/20pwa dev.wasm:8471982
    EventSystem_Update_m9D0AC1A7236F0DA1CCA0A8FFE0D8D33D960D433C http://localhost:63343/20pwa dev/Build/20pwa dev.wasm:8449333
    RuntimeInvoker_TrueVoid_t4861ACF8F4594C3437BB48B6E56783494B843915(void (*)(), MethodInfo const*, void*, void**, void*) http://localhost:63343/20pwa dev/Build/20pwa dev.wasm:39270027
    il2cpp::vm::Runtime::InvokeWithThrow(MethodInfo const*, void*, void**) http://localhost:63343/20pwa dev/Build/20pwa dev.wasm:39856349
    dynCall_iiii http://localhost:63343/20pwa dev/Build/20pwa dev.wasm:53826861
    unityFramework http://localhost:63343/20pwa dev/Build/20pwa dev.framework.js:898
    invoke_iiii http://localhost:63343/20pwa dev/Build/20pwa dev.framework.js:18677
    il2cpp::vm::Runtime::Invoke(MethodInfo const*, void*, void**, Il2CppException**) http://localhost:63343/20pwa dev/Build/20pwa dev.wasm:39840060
    il2cpp_runtime_invoke http://localhost:63343/20pwa dev/Build/20pwa dev.wasm:1249704
    scripting_method_invoke(ScriptingMethodPtr, ScriptingObjectPtr, ScriptingArguments&, ScriptingExceptionPtr*, bool) http://localhost:63343/20pwa dev/Build/20pwa dev.wasm:53425125
    ScriptingInvocation::Invoke(ScriptingExceptionPtr*, bool) http://localhost:63343/20pwa dev/Build/20pwa dev.wasm:53051581
    MonoBehaviour::CallUpdateMethod(int) http://localhost:63343/20pwa dev/Build/20pwa dev.wasm:52723252
    MonoBehaviour::Update() http://localhost:63343/20pwa dev/Build/20pwa dev.wasm:52723273
    void BaseBehaviourManager::CommonUpdate<BehaviourManager>() http://localhost:63343/20pwa dev/Build/20pwa dev.wasm:52941677
    BehaviourManager::Update() http://localhost:63343/20pwa dev/Build/20pwa dev.wasm:52941005
    InitPlayerLoopCallbacks()::UpdateScriptRunBehaviourUpdateRegistrator::Forward() http://localhost:63343/20pwa dev/Build/20pwa dev.wasm:43758563
    ExecutePlayerLoop(NativePlayerLoopSystem*) http://localhost:63343/20pwa dev/Build/20pwa dev.wasm:43620015
    ExecutePlayerLoop(NativePlayerLoopSystem*) http://localhost:63343/20pwa dev/Build/20pwa dev.wasm:43620195
    PlayerLoop() http://localhost:63343/20pwa dev/Build/20pwa dev.wasm:43620894
    MainLoop() http://localhost:63343/20pwa dev/Build/20pwa dev.wasm:52966954
    dynCall_v http://localhost:63343/20pwa dev/Build/20pwa dev.wasm:53826837
    unityFramework http://localhost:63343/20pwa dev/Build/20pwa dev.framework.js:898
    browserIterationFunc http://localhost:63343/20pwa dev/Build/20pwa dev.framework.js:5977
    callUserCallback http://localhost:63343/20pwa dev/Build/20pwa dev.framework.js:5254
    runIter http://localhost:63343/20pwa dev/Build/20pwa dev.framework.js:5310
    Browser_mainLoop_runner http://localhost:63343/20pwa dev/Build/20pwa dev.framework.js:5948
    (Async: FrameRequestCallback)
    requestAnimationFrame http://localhost:63343/20pwa dev/Build/20pwa dev.framework.js:5589
    Browser_mainLoop_scheduler_rAF http://localhost:63343/20pwa dev/Build/20pwa dev.framework.js:5835
    Browser_mainLoop_runner http://localhost:63343/20pwa dev/Build/20pwa dev.framework.js:5961
    (Async: FrameRequestCallback)
    requestAnimationFrame http://localhost:63343/20pwa dev/Build/20pwa dev.framework.js:5589
    Browser_mainLoop_scheduler_rAF http://localhost:63343/20pwa dev/Build/20pwa dev.framework.js:5835
    Browser_mainLoop_runner http://localhost:63343/20pwa dev/Build/20pwa dev.framework.js:5961
    (Async: FrameRequestCallback)
    requestAnimationFrame http://localhost:63343/20pwa dev/Build/20pwa dev.framework.js:5589
    Browser_mainLoop_scheduler_rAF http://localhost:63343/20pwa dev/Build/20pwa dev.framework.js:5835
    Browser_mainLoop_runner http://localhost:63343/20pwa dev/Build/20pwa dev.framework.js:5961
    (Async: FrameRequestCallback)
    requestAnimationFrame http://localhost:63343/20pwa dev/Build/20pwa dev.framework.js:5589
    Browser_mainLoop_scheduler_rAF http://localhost:63343/20pwa dev/Build/20pwa dev.framework.js:5835
    Browser_mainLoop_runner http://localhost:63343/20pwa dev/Build/20pwa dev.framework.js:5961
    (Async: FrameRequestCallback)
    requestAnimationFrame http://localhost:63343/20pwa dev/Build/20pwa dev.framework.js:5589
    Browser_mainLoop_scheduler_rAF http://localhost:63343/20pwa dev/Build/20pwa dev.framework.js:5835
    Browser_mainLoop_runner http://localhost:63343/20pwa dev/Build/20pwa dev.framework.js:5961
    (Async: FrameRequestCallback)
    requestAnimationFrame http://localhost:63343/20pwa dev/Build/20pwa dev.framework.js:5589
    Browser_mainLoop_scheduler_rAF http://localhost:63343/20pwa dev/Build/20pwa dev.framework.js:5835
    Browser_mainLoop_runner http://localhost:63343/20pwa dev/Build/20pwa dev.framework.js:5961
    (Async: FrameRequestCallback)
    requestAnimationFrame http://localhost:63343/20pwa dev/Build/20pwa dev.framework.js:5589
    Browser_mainLoop_scheduler_rAF http://localhost:63343/20pwa dev/Build/20pwa dev.framework.js:5835
    Browser_mainLoop_runner http://localhost:63343/20pwa dev/Build/20pwa dev.framework.js:5961
    (Async: FrameRequestCallback)
    requestAnimationFrame http://localhost:63343/20pwa dev/Build/20pwa dev.framework.js:5589
    Browser_mainLoop_scheduler_rAF http://localhost:63343/20pwa dev/Build/20pwa dev.framework.js:5835
    Browser_mainLoop_runner http://localhost:63343/20pwa dev/Build/20pwa dev.framework.js:5961
    (Async: FrameRequestCallback)
    requestAnimationFrame http://localhost:63343/20pwa dev/Build/20pwa dev.framework.js:5589
    Browser_mainLoop_scheduler_rAF http://localhost:63343/20pwa dev/Build/20pwa dev.framework.js:5835
    Browser_mainLoop_runner http://localhost:63343/20pwa dev/Build/20pwa dev.framework.js:5961
    (Async: FrameRequestCallback)
    requestAnimationFrame http://localhost:63343/20pwa dev/Build/20pwa dev.framework.js:5589
    Browser_mainLoop_scheduler_rAF http://localhost:63343/20pwa dev/Build/20pwa dev.framework.js:5835
    Browser_mainLoop_runner http://localhost:63343/20pwa dev/Build/20pwa dev.framework.js:5961
    (Async: FrameRequestCallback)
    requestAnimationFrame http://localhost:63343/20pwa dev/Build/20pwa dev.framework.js:5589
    Browser_mainLoop_scheduler_rAF http://localhost:63343/20pwa dev/Build/20pwa dev.framework.js:5835
    Browser_mainLoop_runner http://localhost:63343/20pwa dev/Build/20pwa dev.framework.js:5961
    (Async: FrameRequestCallback)
    requestAnimationFrame http://localhost:63343/20pwa dev/Build/20pwa dev.framework.js:5589
    Browser_mainLoop_scheduler_rAF http://localhost:63343/20pwa dev/Build/20pwa dev.framework.js:5835
    Browser_mainLoop_runner http://localhost:63343/20pwa dev/Build/20pwa dev.framework.js:5961
    (Async: FrameRequestCallback)
    requestAnimationFrame http://localhost:63343/20pwa dev/Build/20pwa dev.framework.js:5589
    Browser_mainLoop_scheduler_rAF http://localhost:63343/20pwa dev/Build/20pwa dev.framework.js:5835
    Browser_mainLoop_runner http://localhost:63343/20pwa dev/Build/20pwa dev.framework.js:5961
    (Async: FrameRequestCallback)
    requestAnimationFrame http://localhost:63343/20pwa dev/Build/20pwa dev.framework.js:5589
    Browser_mainLoop_scheduler_rAF http://localhost:63343/20pwa dev/Build/20pwa dev.framework.js:5835
    Browser_mainLoop_runner http://localhost:63343/20pwa dev/Build/20pwa dev.framework.js:5961
    (Async: FrameRequestCallback)
    requestAnimationFrame http://localhost:63343/20pwa dev/Build/20pwa dev.framework.js:5589
    Browser_mainLoop_scheduler_rAF http://localhost:63343/20pwa dev/Build/20pwa dev.framework.js:5835
    Browser_mainLoop_runner http://localhost:63343/20pwa dev/Build/20pwa dev.framework.js:5961
    (Async: FrameRequestCallback)
    requestAnimationFrame http://localhost:63343/20pwa dev/Build/20pwa dev.framework.js:5589
    Browser_mainLoop_scheduler_rAF http://localhost:63343/20pwa dev/Build/20pwa dev.framework.js:5835
    Browser_mainLoop_runner

The stacktrace does indeed suggest that the issue is RestSharp. Networking through System.Net or third-party libraries that call native code is not supported on the Web. For networking only UnityWebRequest or libraries that use the browser APIs is supported.

1 Like